Skip to content

fix(quit): release the window registry outside its borrow (#166) - #167

Merged
gnacho merged 1 commit into
masterfrom
fix/166-close-abort
Oct 28, 2026
Merged

gnacho merged 1 commit into
masterfrom
fix/166-close-abort

Conversation

@gnacho

@gnacho gnacho commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Closing the window with the close button (or Alt+F4) left the window registry borrowed while the last reference was released during shutdown. The destroy handler then found the RefCell already borrowed, the panic could not unwind through C and the process aborted, so every normal window close ended as a crash.

The registry is now pruned through a non blocking helper (try_with + try_borrow_mut) and the window vector is taken out of the thread local before the references are dropped, so the reentry that #141 handled through the TLS destructors is covered here too.

Verified with a real window manager: 0.3.30 aborts with SIGABRT (exit 134) on 3 of 3 window closes, the fixed build exits 0 on 3 of 3. The regression test fails if the helper borrows the registry directly instead of using try_borrow_mut.

Closes #166

@gnacho
gnacho merged commit 87989ea into master Oct 28, 2026
3 checks passed
@gnacho
gnacho deleted the fix/166-close-abort branch October 28, 2026 08:38
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

Successfully merging this pull request may close these issues.

Scribe triggers crash notification even when closing normally on Fedora KDE (Flatpak)

1 participant