diff --git a/ChangeLog b/ChangeLog index 6204a2ef2..11c241171 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-03 Mike Kestner + + * glib/Object.cs: revert to old LookupType behavior when Handle is + not set. [Fixes #500417] + 2009-05-03 Stephane Delcroix * glib/Idle.cs: @@ -32,7 +37,7 @@ * gtk/Widget.custom: Implement signal registration for the Activate, SettScrollAdjustments and key binding signals - in managed code. + in managed code. 2009-04-25 Mike Kestner diff --git a/glib/Object.cs b/glib/Object.cs index c0e6eb8fb..61d1e61d7 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -323,9 +323,13 @@ namespace GLib { protected GType LookupGType () { - GTypeInstance obj = (GTypeInstance) Marshal.PtrToStructure (Handle, typeof (GTypeInstance)); - GTypeClass klass = (GTypeClass) Marshal.PtrToStructure (obj.g_class, typeof (GTypeClass)); - return new GLib.GType (klass.gtype); + if (Handle != IntPtr.Zero) { + GTypeInstance obj = (GTypeInstance) Marshal.PtrToStructure (Handle, typeof (GTypeInstance)); + GTypeClass klass = (GTypeClass) Marshal.PtrToStructure (obj.g_class, typeof (GTypeClass)); + return new GLib.GType (klass.gtype); + } else { + return LookupGType (GetType ()); + } } protected internal static GType LookupGType (System.Type t)