From c9434076c50fcd6d664fecdff9d5e9c09dbae738 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 12 Sep 2002 19:21:46 +0000 Subject: [PATCH] 2002-09-11 Miguel de Icaza * glib/Object.cs (DisposeNative): Call GC.SuppressFinalize, and set the obj to null. svn path=/trunk/gtk-sharp/; revision=7411 --- ChangeLog | 5 +++++ glib/Object.cs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b01e9289f..ad317ffd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-11 Miguel de Icaza + + * glib/Object.cs (DisposeNative): Call GC.SuppressFinalize, and + set the obj to null. + 2002-09-11 Rachel Hestilow * glib/Object.cs (Ref): Added. diff --git a/glib/Object.cs b/glib/Object.cs index 25e09f6f8..6f7e0dc11 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -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")]