Re: Floating references



Chris Vine wrote:
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.

CPython starts reference counts at 1, and it works perfectly
well -- the code that allocates the object initially owns a
reference to it, which it is obliged to dispose of in some
way. I can't see why GInitiallyUnowned was thought to be
needed.

--
Greg


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