[Gtk-sharp-list] Ref handling patch

Miguel de Icaza miguel@ximian.com
24 Jul 2003 11:06:54 -0400


Hello,

> I just committed a patch that Ettore Perazzoli and I have been bouncing
> back and forth at each other for about a week now. Ettore had done some
> instrumenting of a Gtk# app he wrote.  Gtk# used to leak like a sieve.

Monodoc is working fine;  But my old mPhoto application is having a
little trouble with it:

(Mphoto:12822): GLib-GObject-CRITICAL **: file gobject.c: line 1337
(g_object_unref): assertion `G_IS_OBJECT (object)' failed

Eventually this leads to a crash:

Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required
in (unmanaged) 06 GLib.Object:g_object_unref (intptr)
in <0x00004> 06 GLib.Object:g_object_unref (intptr)
in <0x0014a> 00 GLib.Object:PerformQueuedUnrefs ()
in <0x0001b> 05 GLib.Object:PerformQueuedUnrefs ()
in (unmanaged) 06 Gtk.Application:gtk_main ()

What are the common mistakes for a developer that should be different
with the new Gtk#?

Miguel