Re: GTK_OBJECT_DESTROYED



On 17 Nov 2001, Owen Taylor wrote:

> Basically, uses of GTK_OBJECT_DESTROYED() probably indicate one of two
> things:
> 
>  a) The caller wants to make sure they don't accidentally 
>     segfault the object by trying to access freed memory
>     or other no longer valid state in the widget.
> 
>  b) The caller wants to do something different based 
>     on whether the object has been destroyed or not.

if he intends to do this, he should either connect to ::destroy, or
install weak references.

> I'd be interested in hearing other opinions, however.

i definitely think we have to remove it.
that gets people to fix there code for case (b). one thing you didn't 
make obviously clear is, that even if we leave the macro in and current
code remains to compile, the flag test will be a NOP since we we have to
reset the DESTROYED flag after the ::destroy emission.

as an outcome, leaving GTK_OBJECT_DESTROYED() in place will only do
one thing:
the fact that people _must_ fix their code is being hidden from them.

> 
> Regards,
>                                         Owen

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]