Re: should destroying set the refcount to 0?
- From: Owen Taylor <otaylor redhat com>
- To: Maciej Stachowiak <mjs eazel com>
- Cc: gnome-components-list gnome org
- Subject: Re: should destroying set the refcount to 0?
- Date: 29 Mar 2000 11:16:22 -0500
Maciej Stachowiak <mjs@eazel.com> writes:
> Should bonobo_object_destroy set the refcount to 0?
Almost certainly not. If you have refcounting on an object
then you can't also have explicit destruction.
For example: gtk_object_destroy() does not directly affect
the refcount at all. The only reason it usually results in
a widget being freed is that it remove the widget from its
parent, so the refcount drops to zero.
Either you have to have no _destroy() and just use unref(),
or you have to make _destroy() a "break known references"
operation.
Regards,
Owen
> 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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]