|
Boost Users : |
Subject: Re: [Boost-users] how to help an object to delete itself the boost way
From: Richard Damon (Richard_at_[hidden])
Date: 2015-12-17 21:50:20
On 12/17/15 3:15 PM, Ireneusz SzczeÅniak wrote:
> Hi Ian,
>
> Thanks for your email. I only wonder how an object should trigger its
> deletion...
>
>
> Best,
> Irek
The big issue that I see is how do you know that the object was created
via new? (that is the only sort of object that CAN be deleted).
Also, if the object deletes itself, it somehow must make sure that no
one else has kept a copy of its address and might try to access after it
has deleted itself.
Both of these questions, and some of your comments, point somewhat to
the idea that it might not be the object that wants to delete itself,
but that the object may be part of some framework, and it should inform
the framework that it is done, and the framework can then remove the
object and delete it.
-- Richard Damon
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