← Back to team overview

ffc team mailing list archive

Changed storage of constants from reference to copy in forms. This is [...]

 

Commit from johanjan (2005-09-11 13:16 CEST)
--------------------

Changed storage of constants from reference to copy in forms. This is
to avoid this type of subtle memory error:

class LinearForm
{
public:
 Linearform(real& c0) : c0(c0)
 {
 }
 real& c0;
}

class MySolver
{
public:
 MySolver(real c) : L(c)
 {
   // !!! After this constructor returns, the contents of LinearForm::c0 are
   // no longer allocated.
 }
 LinearForm L;
}

  ffc  src/ffc/format/dolfin.py  1.34



Follow ups