Install SIGINT/SIGTERM handlers for clean shutdown - #53
Open
jEsuSdA wants to merge 1 commit into
Open
Conversation
Currently, fastcompmgr exits uncleanly when receiving SIGINT or SIGTERM, leaving X resources (pictures, regions) unreleased and the X connection open. This can cause leaks or leave the display in an inconsistent state if the compositor is restarted frequently. Changes: - Add signal_handler() that sets a volatile flag on SIGINT/SIGTERM - Install handlers in main() after X11 init - Check the flag in the event loop and break cleanly - On exit, free root_buffer, root_picture, root_tile, all_damage, g_xregion_tmp, and close the X display properly This ensures the compositor releases its X resources and closes the display connection gracefully on normal termination signals.
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.
Summary
Adds
SIGINT/SIGTERMhandlers so the compositor shuts down cleanly instead of leaving X resources unreleased.Problem
Currently, fastcompmgr exits uncleanly when receiving
SIGINTorSIGTERM, leaving X resources (pictures, regions) unreleased and the X connection open. This can cause leaks or leave the display in an inconsistent state if the compositor is restarted frequently.Solution
signal_handler()that sets a volatile flag onSIGINT/SIGTERMmain()after X11 initroot_buffer,root_picture,root_tile,all_damage,g_xregion_tmp, and close the X display properlyScope
fastcompmgr.cis touchedmake clean && makeproduces zero warnings, zero errorsImpact
The compositor now releases its X resources and closes the display connection gracefully on normal termination signals. No functional change during normal operation.