← Back to team overview

ffc team mailing list archive

Re: deleting ufc_form

 

On Mon, Nov 24, 2008 at 09:39:45PM +0100, Johan Hake wrote:
> Hello!
> 
> While working on the python interface of dolfin I come over a memory 
> corruption in the dolfin::Form destructor. While ffc -ldolfin produce code to 
> instantiate a dolfin::Form it does not take care of deleting the ufc_form.
> 
> In the destrutor of the base class Form there is a 
> 
>   delete _ufc_form;
> 
> I do not know if this while prevent any memory leak from the ffc produced 
> code, e.g., if the base class destructor is not calle or something, but that 
> line _will_ corrupt any try to instantiate a dolfin::Form directly using an 
> ufc_form, which we have to do in PyDOLFIN. 
> 
> My suggestion is to remove the above mentioned line from dolfin::~Form(), 
> which I have done locally, and add the same line in the destructor of the 
> derived class produced by ffc.
> 
> Any comment?
> 
> Johan

Sounds good. Patches welcome. Will get started on applying your other patches.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References