Re: Floating references
- From: Rafal Luzynski <digitalfreak lingonborough com>
- To: gtk-list gnome org, Chris Vine <vine35792468 gmail com>
- Subject: Re: Floating references
- Date: Tue, 6 Jun 2017 23:32:38 +0200 (CEST)
6.06.2017 22:28 Chris Vine <vine35792468 gmail com> wrote:
[...]
GObjects not derived from GInitiallyUnowned are indeed weird, as I think
you are suggesting. They start with a reference count of 1 but without
an owner.
As far as I understand owned object were supposed to be the widgets
contained inside the containers. Not all widgets are contained (toplevel
windows are not), also not all objects are widgets.
But on further thought I suspect you are right: the floating reference
was to circumvent this problem. So I guess the question is why pure
(non-GInitiallyUnowned) GObjects start with a reference count of 1,
instead of a count of 0 as in other similar implementations. Starting
with a count of 0 would have made floating references unnecessary.
I can't tell for sure. Maybe (as I wrote before) the floating reference
feature was not always expected to exist, maybe it simplified some
things, maybe it does not matter that much and the system works the same
no matter if the initial reference count is 0 or 1 or some other number.
Regards,
Rafal
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]