[Gc] Memory leak in multithreaded application

Christophe Meessen meessen at cppm.in2p3.fr
Sat May 12 06:54:50 PDT 2007

I have found the source of the problem but it is not trivial to diagnose.

I have this

class PDUi : virtual public gc_cleanup { ... }
class PDUo : virtual public gc_cleanup { ... }
class PDUio : public PDUi, public PDUo { ... }

PDUi and PDUo are just abstract base classes.

When I switch gc_cleanup to gc, I don't have any memory leak.

The client uses the same class but didn't show the memory leak because
PDUio was allocated on the stack.

Now the problem is that I need the destructor to be called because some
inherited objets release allocated resources like mutexes, sockets and
such. mutex allocation and release is built in boost mutex classes.

I also have other gc_cleanup derived classes pointing to this PDUio
class. Could this matter ?

More information about the Gc mailing list