← Back to team overview

dolfin team mailing list archive

[Bug 44] New: Memory leak in XMLFile

 

http://www.fenics.org/cgi-bin/bugzilla/show_bug.cgi?id=44

           Summary: Memory leak in XMLFile
           Product: DOLFIN
           Version: development version
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: general
        AssignedTo: dolfin-dev@xxxxxxxxxx
        ReportedBy: garth@xxxxxxxxxx


A memory leak is created when reading a Function from an XML file. The problem
is that

  void XMLFile::operator>>(Function& f)

allocates memory for pointers to a Mesh and Vector and uses these to construct
a DiscreteFunction, but the DiscreteFunction does take ownership of the Vector
and Mesh.

I solution could be to use smart pointers.


-- 
Configure bugmail: http://www.fenics.org/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.