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,11 +111,10 @@
return base.Raw;
}
set {
base.Raw = value;
if (value == IntPtr.Zero)
return;
if (value != IntPtr.Zero)
g_object_ref_sink (value);
base.Raw = value;
if (value != IntPtr.Zero)
InternalDestroyed += NativeDestroyHandler;
}
}
@ -123,7 +124,9 @@
public virtual void Destroy ()
{
if (Handle != IntPtr.Zero)
if (Handle == IntPtr.Zero)
return;
InternalDestroyed -= NativeDestroyHandler;
gtk_object_destroy (Handle);
}