diff --git a/ChangeLog b/ChangeLog index 86a719891..31efecac8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-02 Mike Kestner + + * glib/Object.cs: Don't bother hooking VM into the class field + if another managed ancestor has already done so. Add a LogFunc + printing a stack trace for the GObject log domain if GTK_SHARP_DEBUG + is set in the environment. It's a bit noisy to do unconditionally. + 2008-05-02 Mike Kestner * gtk/Object.custom: some NULL guarding in Dispose and diff --git a/glib/Object.cs b/glib/Object.cs index 2c0127fbb..fa2eb0263 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -139,6 +139,18 @@ namespace GLib { if (baseinfo == minfo) continue; + bool ignore = false; + for (Type parent = t.BaseType; parent != baseinfo.DeclaringType; parent = parent.BaseType) { + MethodInfo pinfo = parent.GetMethod (minfo.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly); + if (pinfo != null) { + ignore = true; + break; + } + } + + if (ignore) + continue; + foreach (object attr in baseinfo.GetCustomAttributes (typeof (DefaultSignalHandlerAttribute), false)) { DefaultSignalHandlerAttribute sigattr = attr as DefaultSignalHandlerAttribute; MethodInfo connector = sigattr.Type.GetMethod (sigattr.ConnectionMethod, BindingFlags.Static | BindingFlags.NonPublic); @@ -521,11 +533,10 @@ namespace GLib { tref.Harden (); } -#if false static Object () { - GLib.Log.SetLogHandler ("GLib-GObject", GLib.LogLevelFlags.All, GLib.Log.PrintTraceLogFunction); + if (Environment.GetEnvironmentVariable ("GTK_SHARP_DEBUG") != null) + GLib.Log.SetLogHandler ("GLib-GObject", GLib.LogLevelFlags.All, GLib.Log.PrintTraceLogFunction); } -#endif } }