Repository navigation
core: release client proxies before the display disconnects - #160
Merged
Merged
Conversation
apps hold their windows and outputs across enterLoop() and drop them after it returns, but cleanup() has already disconnected the display by then, so every proxy they still own gets destroyed on freed memory. since hyprwm#120 a lost compositor ends the loop instead of aborting, so every toolkit app now crashes this way at session end (hyprpaper in ~CWaylandOutput, layers, lock surfaces). drop every window, layer, lock surface, popup and output proxy at the start of cleanup(), and let a popup be destroyed after the backend is gone. fixes hyprwm#134
vaxerski
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apps keep their windows, layers and outputs alive across
enterLoop()and only drop them after it returns (backend->enterLoop(); return 0;with the window still in scope). by thencleanup()has already disconnected the display, so every proxy they still own gets destroyed against a dead connection. since #120 a lost compositor ends the loop instead of aborting, so this is how toolkit apps go down at session end now.this releases every window, layer, lock surface, popup and output proxy at the start of
cleanup(), while the display is still there. a popup can also be dropped after the backend is gone, soCWaylandPopup::close()checksg_waylandPlatformfirst.repro is a nested hyprland: run a client on it and
kill -TERMthe compositor. on main the client segfaults every time, in~CWaylandWindow->close()->CCXdgToplevel::sendDestroyfor a window,~CCZwlrLayerSurfaceV1for a layer,~CCWlOutputfor hyprpaper.simpleWindow,simpleLayer,simpleSessionLockand hyprpaper (433a96b) each went from SIGSEGV 3/3 on main to exit 0 3/3 with this. closing thedialogwindow normally while the compositor stays up exits 0 before and after, and the unit suite passes.Fixes #134.