Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Interprocess Question
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-10-07 16:46:52


El 07/10/2011 2:15, Brian escribió:

> Is there anyway I can delete the constructed object using b? I tried
> segment.destroy_ptr(b.get()) and segment.deallocate(b.get()) but I
> get assertion failures. Obviously segment.destroy_ptr(a.get()) would
> work but I'd like to be able to do it with a pointer to the parent
> class. Also casting won't work because I won't know if it's a dog or
> a cat when I delete it.

No, you need virtual destructors for that, and classes with virtual
operations are not safely placeable in shared memory.

Best,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net