UI: Fix crash when exiting with a multitrack video stream active #10890
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.
Not entirely sure if this is a good fix/the right fix, commit title etc is somewhat not final cc @tt2468, @RytoEX
Description
changes order that multitrack video output encoders and outputs are released in, to work around a crash on shutdown while the multitrack video output is active
Motivation and Context
exiting obs while the multitrack video output is active will currently cause obs to crash:
code around the crash
obs-studio/libobs/obs-encoder.c
Lines 358 to 360 in 608d3bf
->
remove_connection
callsobs_encoder_group_actually_destroy
which in turn releases the last strong ref to the current encoder so encoder is an invalid pointer inremove_connection
after that point, and it currently crashes inpthread_mutex_unlock(&encoder->encoder_group->mutex)
for meHow Has This Been Tested?
exited obs with multitrack video output active and it no longer crashes
Types of changes
Checklist: