GC BUG: Referenced object destroyed before released

Koroskin Denis 2korden+dmd at gmail.com
Mon Mar 17 03:38:06 PDT 2008


On Mon, 17 Mar 2008 06:06:49 +0300, Vladimir Panteleev  
<thecybershadow at gmail.com> wrote:

> On Mon, 17 Mar 2008 00:28:04 +0200, Graham St Jack  
> <grahams at acres.com.au> wrote:
>
>> I agree that this is a problem. Who cares if the two objects in question
>> aren't referenced and more - their destructors should be called in the
>> right order if it is possible to do so.
>
> This is impossible without an exact garbage collector.
>
> Also: circular references.
>

Indeed, it's hard to implement if possible. And it is a design problem if  
not possible.

But if it is so bad, then we need a safe pattern that would avoid this  
problem. And maybe build it into language somehow???
Disabling access to other objects in a destructor is really a bad option...

I would also be happy to hear Walter's comment on this.



More information about the Digitalmars-d mailing list