diff --git a/ChangeLog b/ChangeLog index 8eda6e18b..6819cfd47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-21 Christian Hoff + + * glib/Value.cs: Fixes for fundamental GType support. Patch + provided by Sebastian Dröge. + 2009-04-21 Christian Hoff * gtk/Widget.custom: Deglued implementation of StyleGetProperty. diff --git a/glib/Value.cs b/glib/Value.cs index 0a5f33510..f8abcc50b 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -346,7 +346,8 @@ namespace GLib { while (ci == null && t != null) { if (!t.IsAbstract) ci = t.GetConstructor (new Type[] { typeof (GLib.Value) }); - t = t.BaseType; + if (ci == null) + t = t.BaseType; } } catch (Exception) { ci = null; @@ -364,10 +365,11 @@ namespace GLib { try { while (mi == null && t != null) { - mi = t.GetMethod ("SetGValue", new Type[] { typeof (GLib.Value) }); - if (mi.IsAbstract) + mi = t.GetMethod ("SetGValue", new Type[] { Type.GetType ("GLib.Value&") }); + if (mi != null && (mi.IsAbstract || mi.ReturnType != typeof (void))) mi = null; - t = t.BaseType; + if (mi == null) + t = t.BaseType; } } catch (Exception) { mi = null; @@ -376,7 +378,9 @@ namespace GLib { if (mi == null) throw new Exception ("Unknown type " + new GType (type).ToString ()); - mi.Invoke (val, new object[] { this }); + object[] parameters = new object[] { this }; + mi.Invoke (val, parameters); + this = (GLib.Value) parameters[0]; } object ToBoxed ()