Skip to content

window: Add weak reference to the active slot

António Fernandes requested to merge 1759-crash-closing-last-tab into master

We used to explicitly set the active slot when closing a tab. However, we now let GtkNotebook pick the next tab, and wait for ::switch-tab to set the active_slot field to the one GtkNotebook picked, thanks to commit 475684ac.

However, if the closed tab was the only tab in this window, then ::switch-tab is never called, so active_slot becomes a dangling pointer, crashing the application when trying to close the window.

Use a weak reference to ensure the pointer is set to NULL in that case.

Fixes #1759 (closed)

Closes #1759 (closed)

Merge request reports