2002-09-11 Miguel de Icaza <miguel@ximian.com>

* glib/Object.cs (DisposeNative): Call GC.SuppressFinalize, and
	set the obj to null.

svn path=/trunk/gtk-sharp/; revision=7411
This commit is contained in:
Miguel de Icaza 2002-09-12 19:21:46 +00:00
parent 32ae593a0e
commit c9434076c5
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2002-09-11 Miguel de Icaza <miguel@ximian.com>
* glib/Object.cs (DisposeNative): Call GC.SuppressFinalize, and
set the obj to null.
2002-09-11 Rachel Hestilow <hestilow@ximian.com>
* glib/Object.cs (Ref): Added.

View file

@ -55,13 +55,15 @@ namespace GLib {
[DllImport("gobject-2.0")]
static extern void g_object_unref (IntPtr raw);
protected virtual void DisposeNative ()
{
if (_obj == IntPtr.Zero)
return;
GC.SuppressFinalize (this);
g_object_unref (_obj);
_obj = IntPtr.Zero;
}
[DllImport("gobject-2.0")]