2008-04-04 Mike Kestner <mkestner@novell.com>

* atk/Object.custom: take out a ref on the return value of
	OnRefChild.  Also add some null guarding and default to IntPtr.Zero
	on exceptions.

svn path=/trunk/gtk-sharp/; revision=99826
This commit is contained in:
Mike Kestner 2008-04-04 05:00:42 +00:00
parent b1d6be02d5
commit 1a64851790
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2008-04-04 Mike Kestner <mkestner@novell.com>
* atk/Object.custom: take out a ref on the return value of
OnRefChild. Also add some null guarding and default to IntPtr.Zero
on exceptions.
2008-04-01 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs: support "generic" interface

View File

@ -61,16 +61,22 @@
static RefChildDelegate RefChildCallback;
[DllImport("libgobject-2.0-0.dll")]
static extern IntPtr g_object_ref (IntPtr handle);
static IntPtr RefChild_cb (IntPtr raw, int i)
{
try {
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
return obj.OnRefChild(i).Handle;
Atk.Object child = obj.OnRefChild (i);
if (child != null)
g_object_ref (child.Handle);
return child == null ? IntPtr.Zero : child.Handle;
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
return GLib.GType.Invalid.Val;
return IntPtr.Zero;
}