Re: should destroying set the refcount to 0?



Christopher Blizzard <blizzard@redhat.com> writes:

> Maciej Stachowiak wrote:
> > 
> > Should bonobo_object_destroy set the refcount to 0? Right now, if you
> > destroy the object, it does some cleanup (including
> > gtk_signal_disconnects and gtk_object_destroys), but does not set the
> > refcount to 0. If the refcount ever does hit zero, that cleanup tries
> > to happen again, but fails.
> 
> Pardon my igornance but shouldn't the object's destructor be called as a
> result of the refcnt being dropped to zero?  This would be the expected
> behaviour, imho.  What is happening now?

It does get called as a result of the refcnt being dropped to 0 (well,
not really, the code was cut & pasted, but Darin is going to fix
that). The problem is if you destroy explicitly (which may happen as a
result of code on the client side doing an explicit destroy), then
later dropping the refcount to 0 will cause another attempted destroy
and result in problems.

 - Maciej



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