Hi,

Julien PUYDT a écrit :
>>> I've been introducing a CleanUp() static method in those I found, so as
>>> to delete the singleton of the considered class. This has so far removed
>>> about 1MB of leaks on program exit, but a big number of them remains.
[...]
> There's another way : a master object takes ownership of the singletons.
> 
> Basically :
> 
> int
> main (...)
> {
>   Master master;
> 
>   master.assume_ownership_of (new singleton1);
>   ...
>   master.assume_ownership_of (new singletonN);
> 
>   return 0; // getting out releases the master, hence all singletons
> }

In fact I had decided to take what I thought was another path, but the
object I selected is simply a vector of instances.

There is more to explain about, it but let's not split the discussion
over several subthreads. I propose we continue discussing this point
over the mail where I'll attach a patch.

Best regards,
-- 
Kurosu

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à