2005-08-26 John Luke <john.luke@gmail.com>
* glib/Signal.cs: deal with obj.Handle == IntPtr.Zero to avoid assertions svn path=/trunk/gtk-sharp/; revision=48959
This commit is contained in:
parent
32e6f7df76
commit
a12a4b48f0
2 changed files with 14 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-08-26 John Luke <john.luke@gmail.com>
|
||||||
|
|
||||||
|
* glib/Signal.cs: deal with obj.Handle == IntPtr.Zero
|
||||||
|
to avoid assertions
|
||||||
|
|
||||||
2005-08-25 Mike Kestner <mkestner@novell.com>
|
2005-08-25 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* configure.in.in : move GACUTIL check forward ahead of a use.
|
* configure.in.in : move GACUTIL check forward ahead of a use.
|
||||||
|
|
|
@ -70,7 +70,8 @@ namespace GLib {
|
||||||
this.marshaler = marshaler;
|
this.marshaler = marshaler;
|
||||||
gc_handle = GCHandle.Alloc (this);
|
gc_handle = GCHandle.Alloc (this);
|
||||||
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
||||||
g_object_set_data_full (handle, native_key, (IntPtr) gc_handle, notify);
|
if (handle != IntPtr.Zero)
|
||||||
|
g_object_set_data_full (handle, native_key, (IntPtr) gc_handle, notify);
|
||||||
GLib.Marshaller.Free (native_key);
|
GLib.Marshaller.Free (native_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +83,11 @@ namespace GLib {
|
||||||
public static Signal Lookup (GLib.Object obj, string name, Delegate marshaler)
|
public static Signal Lookup (GLib.Object obj, string name, Delegate marshaler)
|
||||||
{
|
{
|
||||||
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
||||||
IntPtr data = g_object_get_data (obj.Handle, native_key);
|
IntPtr data;
|
||||||
|
if (obj.Handle == IntPtr.Zero)
|
||||||
|
data = IntPtr.Zero;
|
||||||
|
else
|
||||||
|
data = g_object_get_data (obj.Handle, native_key);
|
||||||
GLib.Marshaller.Free (native_key);
|
GLib.Marshaller.Free (native_key);
|
||||||
if (data == IntPtr.Zero)
|
if (data == IntPtr.Zero)
|
||||||
return new Signal (obj, name, marshaler);
|
return new Signal (obj, name, marshaler);
|
||||||
|
@ -152,7 +157,8 @@ namespace GLib {
|
||||||
void DisconnectObject ()
|
void DisconnectObject ()
|
||||||
{
|
{
|
||||||
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (name + "_signal_marshaler");
|
||||||
g_object_set_data (handle, native_key, IntPtr.Zero);
|
if (handle != IntPtr.Zero)
|
||||||
|
g_object_set_data (handle, native_key, IntPtr.Zero);
|
||||||
GLib.Marshaller.Free (native_key);
|
GLib.Marshaller.Free (native_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue