← Back to team overview

ffc team mailing list archive

deleting ufc_form

 

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


Follow ups