[gecode-users] Actor::dispose
Christian Schulte
cschulte at kth.se
Wed Sep 19 15:54:14 CEST 2007
Yes, that is correct. The reason why we do not use destructors is because
destructors do not support arguments: however, as you might have experienced
yourself already, during destruction the home space is typically needed.
There is one other catch: when a space is destructed (for example after it
has failed), only dispose member functions for actors are called that have
registered by calling force (please check the doc). Or check some examples
(eg. regular/dom.icc). The reason for this: most propagators do not use any
external resources, they just use space-allocated memory. In that case there
is no reason to call dispose...
Good luck!
Christian
--
Christian Schulte, www.ict.kth.se/~schulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Filip Konvicka
Sent: Wednesday, September 19, 2007 3:45 PM
To: users at gecode.org
Subject: [gecode-users] Actor::dispose
Dear Gecode gurus,
I'm currently tracking down some memory leaks that occur when I'm using
Gecode. I have custom propagators and branchings, and both have some
non-trivial members (vectors and other data structures). What surprised
me was that nobody calls the destructors of the vectors, and what's
more, not even the destructors of the actors. Then I remembered seeing
something about dispose() in Gecode 1.2.0 changelog. I ended up calling
the members' destructors explicitly in dispose(). Is this the correct
approach, or am I missing something?
Thanks,
Filip
_______________________________________________
Gecode users mailing list
users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list