Re: [Bug 111028] Dealing with reference cycles in GObject



On 2003.04.25 17:15 Owen Taylor wrote:

> Just storing the pointer doesn't create a a reference; (C and GTK+ don't
> have that sort of sophistication) you have to call g_object_ref() to 
> create the reference.

Thanks, I'm not that much of a beginner :-) I was referring to the
reference cycle that would be created if I fixed bug 111028 by moving to
a system of using g_object_ref() to count the references "properly". As
it turns out, I sidestepped the problem, but it's good to know that weak
references are the way to solve this if I come across it in the future.

[snip re. my problems with resource leaks in my application]

> I think what would be useful is to create the smallest test case
> you can that leaks memory (make a tiny program with a loop that
> just sits there and leaks memory), and then we should be able
> to look at it and see if we can figure out what is going.

Yes, I may end up doing this but it's not going to be easy. It's
a large program that also uses GtkExtra. In addition the resource
leak is GDI memory although there probably is also some heap memory
associated with this as well. The same problem doesn't occur under
Linux but that could be for any number of reasons. My current plan
is to hack a way to access Tor's win32 handle hash table and watch
how the win32 handles expand as I use the application.

[Appologies for wandering off-topic for gtk-devel...]

-- 
Ali Harlow                              Email: ali avrc city ac uk
Research programmer                     Tel:   (020) 7040 4348
Applied Vision Research Centre          Intl: +44 20 7040 4348
City University                         Fax:   (020) 7040 5515
London                                  Intl: +44 20 7040 5515



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