2008-05-02 Mike Kestner <mkestner@novell.com>

* gtk/Object.custom: some NULL guarding in Dispose and 
	Destroy handling.

svn path=/trunk/gtk-sharp/; revision=102347
This commit is contained in:
Mike Kestner 2008-05-02 16:51:37 +00:00
parent 9ff6fc7588
commit 9bc789f2e6
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2008-05-02 Mike Kestner <mkestner@novell.com>
* gtk/Object.custom: some NULL guarding in Dispose and
Destroy handling.
2008-05-02 Mike Kestner <mkestner@novell.com>
* atk/Atk.metadata: hide Global.AddGlobalEventListener.

View file

@ -97,6 +97,8 @@
public override void Dispose ()
{
if (Handle == IntPtr.Zero)
return;
InternalDestroyed -= NativeDestroyHandler;
base.Dispose ();
}
@ -109,12 +111,11 @@
return base.Raw;
}
set {
if (value != IntPtr.Zero)
g_object_ref_sink (value);
base.Raw = value;
if (value == IntPtr.Zero)
return;
g_object_ref_sink (value);
InternalDestroyed += NativeDestroyHandler;
if (value != IntPtr.Zero)
InternalDestroyed += NativeDestroyHandler;
}
}
@ -123,8 +124,10 @@
public virtual void Destroy ()
{
if (Handle != IntPtr.Zero)
gtk_object_destroy (Handle);
if (Handle == IntPtr.Zero)
return;
InternalDestroyed -= NativeDestroyHandler;
gtk_object_destroy (Handle);
}
[DllImport("gtksharpglue-2")]