Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dlang
gtkd
Commits
1282f0ac
Commit
1282f0ac
authored
Jun 16, 2019
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
generated/gtkd/gtk/Container.d
View file @
1282f0ac
...
...
@@ -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
)
...
...
src/APILookupGtk.txt
View file @
1282f0ac
...
...
@@ -1050,6 +1050,16 @@ code: start
Signals.connect(this, "remove", cast(GCallback)>kd_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, >kd_container_add, null);
g_signal_handlers_disconnect_matched(gtkContainer, GSignalMatchType.FUNC, 0, g_quark_from_string("remove"), null, >kd_container_remove, null);
}
private Widget[] children;
static extern(C) void gtkd_container_add(GtkContainer* c, GtkWidget* w)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment