2008-05-30 Mike Kestner <mkestner@novell.com>
* gtk/Object.custom: * gtk/glue/object.c: remove the destroy override. it doesn't work. svn path=/trunk/gtk-sharp/; revision=104558
This commit is contained in:
parent
f3f0a62918
commit
b651056f6c
|
@ -1,3 +1,8 @@
|
||||||
|
2008-05-30 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* gtk/Object.custom:
|
||||||
|
* gtk/glue/object.c: remove the destroy override. it doesn't work.
|
||||||
|
|
||||||
2008-05-28 Mike Kestner <mkestner@novell.com>
|
2008-05-28 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* gtk/Object.custom: move Dispose call to a vm override so that
|
* gtk/Object.custom: move Dispose call to a vm override so that
|
||||||
|
|
|
@ -21,30 +21,6 @@
|
||||||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
// Boston, MA 02111-1307, USA.
|
// Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
[DllImport("gtksharpglue-2")]
|
|
||||||
private static extern bool gtksharp_object_override_destroy (DestroyVMDelegate handler);
|
|
||||||
|
|
||||||
static DestroyVMDelegate destroy_vm_handler;
|
|
||||||
|
|
||||||
static Object ()
|
|
||||||
{
|
|
||||||
destroy_vm_handler = new DestroyVMDelegate (DestroyVMCallback);
|
|
||||||
gtksharp_object_override_destroy (destroy_vm_handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
|
||||||
delegate void DestroyVMDelegate (IntPtr handle);
|
|
||||||
|
|
||||||
static void DestroyVMCallback (IntPtr handle)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, false);
|
|
||||||
if (obj != null)
|
|
||||||
obj.Dispose ();
|
|
||||||
} catch (Exception) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Hashtable destroy_handlers;
|
static Hashtable destroy_handlers;
|
||||||
static Hashtable DestroyHandlers {
|
static Hashtable DestroyHandlers {
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
void gtksharp_object_unref_if_floating (GObject *obj);
|
void gtksharp_object_unref_if_floating (GObject *obj);
|
||||||
gboolean gtksharp_object_is_floating (GObject *obj);
|
gboolean gtksharp_object_is_floating (GObject *obj);
|
||||||
void gtksharp_object_set_floating (GtkObject *obj, gboolean val);
|
void gtksharp_object_set_floating (GtkObject *obj, gboolean val);
|
||||||
void gtksharp_object_override_destroy (gpointer cb);
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -51,24 +50,3 @@ gtksharp_object_set_floating (GtkObject *obj, gboolean val)
|
||||||
gtk_object_sink (obj);
|
gtk_object_sink (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (* destroy_func) (GtkObject *obj);
|
|
||||||
|
|
||||||
static destroy_func base_destroy;
|
|
||||||
static destroy_func managed_destroy;
|
|
||||||
|
|
||||||
static void
|
|
||||||
my_destroy (GtkObject *obj)
|
|
||||||
{
|
|
||||||
(* managed_destroy) (obj);
|
|
||||||
(* base_destroy) (obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gtksharp_object_override_destroy (gpointer cb)
|
|
||||||
{
|
|
||||||
GtkObjectClass *klass = (GtkObjectClass *) g_type_class_ref (GTK_TYPE_OBJECT);
|
|
||||||
base_destroy = klass->destroy;
|
|
||||||
managed_destroy = cb;
|
|
||||||
klass->destroy = my_destroy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue