Commit 1282f0ac authored by Mike Wey's avatar Mike Wey
Browse files

Remove the add and remove signals in the destructor.

This so they don't crach when run during a GC collection cycle.
parent fbd21c45
......@@ -273,6 +273,16 @@ public class Container : Widget
Signals.connect(this, "remove", cast(GCallback)&gtkd_container_remove, null);
}
~this()
{
children = null; //Is this needed?
import gobject.c.functions;
import glib.c.functions;
g_signal_handlers_disconnect_matched(gtkContainer, GSignalMatchType.FUNC, 0, g_quark_from_string("add"), null, &gtkd_container_add, null);
g_signal_handlers_disconnect_matched(gtkContainer, GSignalMatchType.FUNC, 0, g_quark_from_string("remove"), null, &gtkd_container_remove, null);
}
private Widget[] children;
static extern(C) void gtkd_container_add(GtkContainer* c, GtkWidget* w)
......
......@@ -1050,6 +1050,16 @@ code: start
Signals.connect(this, "remove", cast(GCallback)&gtkd_container_remove, null);
}
~this()
{
children = null; //Is this needed?
import gobject.c.functions;
import glib.c.functions;
g_signal_handlers_disconnect_matched(gtkContainer, GSignalMatchType.FUNC, 0, g_quark_from_string("add"), null, &gtkd_container_add, null);
g_signal_handlers_disconnect_matched(gtkContainer, GSignalMatchType.FUNC, 0, g_quark_from_string("remove"), null, &gtkd_container_remove, null);
}
private Widget[] children;
static extern(C) void gtkd_container_add(GtkContainer* c, GtkWidget* w)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment