[gecode-users] memory management problem (newbie)

Jérémie Vautard jeremie.vautard at laposte.net
Sat Jun 17 00:29:06 CEST 2006


Hi !

I had the same kind of problem a while ago. If I remember well, as the 
~Space() method is virtual, it requires the destructor of the descendant 
class (your SudokuSet class, in this case) to be explicitely declared as 
virtual too, so that the Space destructor will be called too.

So, if I'm not mistaken, simply adding
virtual ~SudokuSet() {}

in your class will do the trick...

Cheers,

Jérémie Vautard

Luis Otero a écrit :
> Hi,
> I copied the sudoku-set example into a new class (inheriting directly
> from Space instead of Example).
> It works fine (shouldn't it) but I just discovered that in an endless
> loop (new and delete forever) the memory usage grows without limit.
> I attached the code just in case somebody can help me. Sure I am doing
> something wrong but I don't know what.
>
> Thanks, L.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>   





More information about the gecode-users mailing list