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:
parent
b1d6be02d5
commit
1a64851790
2 changed files with 14 additions and 2 deletions
|
@ -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>
|
2008-04-01 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* generator/InterfaceGen.cs: support "generic" interface
|
* generator/InterfaceGen.cs: support "generic" interface
|
||||||
|
|
|
@ -61,16 +61,22 @@
|
||||||
|
|
||||||
static RefChildDelegate RefChildCallback;
|
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)
|
static IntPtr RefChild_cb (IntPtr raw, int i)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Atk.Object obj = GLib.Object.GetObject (raw, false) as Atk.Object;
|
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) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GLib.GType.Invalid.Val;
|
return IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue