You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue that causes my program to crash if a garbage collection cycle is performed after a dialog is closed.
However, the issue only occurs if the dialog contains children that were constructed by a GtkBuilder.
Essentially:
auto dialog = /* create dialog */;
auto builder = /* create builder */;
auto widget = builder.getObject("widget_id");
dialog.getContentArea().add(widget);
dialog.run();
dialog.destroy();
GC.collect(); // Crash here
However, if I add a widget that I created manually, it works perfectly okay.
Moreover, if I change Builder#getObject(string) as follows, the problem disappears:
// gtk.Builder.d: line 779 - 789public ObjectG getObject(string name)
{
auto p = gtk_builder_get_object(gtkBuilder, Str.toStringz(name));
if(p isnull)
{
returnnull;
}
// Original line://return ObjectG.getDObject!(ObjectG)(cast(GObject*) p);// New line:return ObjectG.getDObject!(ObjectG)(cast(GObject*) p, true);
}
Is this a bug in GtkD, and if so, is this the correct fix?
The text was updated successfully, but these errors were encountered:
I have found that the change in Builder#getObject causes certain other issues, so it's clearly not a correct fix.
However, changing dialog.getContentArea().add(widget) to dialog.getContentArea().packStart(widget, ...) does fix the problem. Although I still find it odd that the original variant segfaults.
I have an issue that causes my program to crash if a garbage collection cycle is performed after a dialog is closed.
However, the issue only occurs if the dialog contains children that were constructed by a GtkBuilder.
Essentially:
However, if I add a widget that I created manually, it works perfectly okay.
Moreover, if I change
Builder#getObject(string)
as follows, the problem disappears:Is this a bug in GtkD, and if so, is this the correct fix?
The text was updated successfully, but these errors were encountered: