Fixed cleanup order of static objects#1668
Open
aleksandr-voitenko wants to merge 1 commit intostagingfrom
Open
Fixed cleanup order of static objects#1668aleksandr-voitenko wants to merge 1 commit intostagingfrom
aleksandr-voitenko wants to merge 1 commit intostagingfrom
Conversation
summeroff
approved these changes
Apr 14, 2026
sandboxcoder
approved these changes
Apr 14, 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.
Description
Fix a shutdown-time
obs_output_release()crash caused by long-livedobs_output_t*owners surviving past libobs teardown.Stack trace:
Motivation and Context
The crash stack shows
obs_output_release()running during CRT process shutdown. That strongly indicates the crash happens in exit-time cleanup, such as a C++ static/global object destructor or another_onexit/atexitcallback. The stack does not prove one specific callback source by itself, but it does point to late process teardown rather than normal streaming runtime.destroyOBS_API()previously released outputs and services through temporary local raw pointers returned byOBS_service::get*(). That cleanup did not clear the real long-lived static owners. The raw output slots were stale-state prone, and more importantly, real auto-release owners such asvirtualCamandenhancedBroadcastContextcould still survive into CRT/static teardown and callobs_output_release()late on already-destroyed libobs objects.Possible shutdown sequence:
obs_output_t*.obs_output_release()expects a still-validoutput->context.control, and the stale second release crashes insideobs_ref_release()/os_atomic_dec_long.How Has This Been Tested?
Manually, Windows only
Types of changes