Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2006-07-10 08:46:35


> yes, the destructor performs two destroy calls in front of the close
> call (see below). But it should not give a damn about, destroyed is
> destroyed. The call of close should only delete objects that still
> exists. I've printed out the name of the named shared object which
> triggers the error (it's "shmDefinition"). If I comment out the two
> lines which destroy my named shared objects in the destructor, it works.
> Hmm, I don't know why it not work when I destroy the objects by hand.
> But definitely it should not be done twice.

You are right. But this indicates that you somehow have tried to erase
the same object (in this case ("shmDefinition")) twice (maybe another
process?). It should assert when using a pointer (because otherwise that
could corrupt all the segment) when deleting the object (a debug
protection like when trying to "operator delete" the same ptr two times).

However, when destroying by name, a bool is returned, saying if the
object has been destroyed or not (well the only problem is to found the
name in the name-object index). So it should return false in the second
case, instead of asserting. The only problem is that both name and
pointer delete operation uses the same code, and only one should assert.
Thanks for finding this!

Please, erase that assertion from your code. I will do the same in
Sandbox-CVS, while I find some other solution.

Regards,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk