Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GtkD 3.4.0 Destroy Dialog Assertion Failure #169

Closed
gnunn1 opened this issue Dec 29, 2016 · 5 comments
Closed

GtkD 3.4.0 Destroy Dialog Assertion Failure #169

gnunn1 opened this issue Dec 29, 2016 · 5 comments

Comments

@gnunn1
Copy link
Contributor

gnunn1 commented Dec 29, 2016

I use the following style of code in Terminix when showing dialogs where a scope(exit) is used tod estroy the dialog:

EditTriggersDialog dlg = new EditTriggersDialog(cast(Window) getToplevel(), gsProfile);
scope (exit) {
    dlg.destroy();
}
dlg.showAll();
if (dlg.run() == ResponseType.APPLY) {
    gsProfile.setStrv(SETTINGS_PROFILE_TRIGGERS_KEY, dlg.getTriggers());
}

This worked fine in 3.3.0 but in the new 3.4.0 version it seems to be generating an assertion failure in GObject:

GLib-GObject:ERROR:gobject.c:2899:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)

It looks to be caused by the unref added in ObjectG.d from this commit, if I comment that out I do not get the assertion failure any longer:

c622205

That commit was to fix a memory leak I reported in #165.

@gnunn1
Copy link
Contributor Author

gnunn1 commented Dec 29, 2016

I tried changing the scope(exit) to a try...finally and it didn't make any difference.

@MikeWey
Copy link
Member

MikeWey commented Dec 30, 2016

I've changed unref, to properly removing the toggle reference. This should stop GTK from trying to call the toggle callback in the cases where that would no longer be possible.

I can no longer reproduce the issue with this change.

@MikeWey MikeWey changed the title GtkD 1.4.0 Destroy Dialog Assertion Failure GtkD 3.4.0 Destroy Dialog Assertion Failure Dec 30, 2016
@gnunn1
Copy link
Contributor Author

gnunn1 commented Dec 30, 2016

Thanks @MikeWey that does indeed work fine. Any chance of getting a 3.4.1 release with this change included?

@gnunn1 gnunn1 closed this as completed Dec 30, 2016
@MikeWey
Copy link
Member

MikeWey commented Dec 30, 2016

Done.

@gnunn1
Copy link
Contributor Author

gnunn1 commented Dec 30, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants