mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
UI: Fix crash at resizing display followed by destruction on macOS
The resize event was triggered during the shtudown of OBS. A commit
9f330050ef
moves the actual resize code in `gl_update` to the main
thread without synchronizing between the main thread and the graphics
thread. When the display context is destroyed just after the resizing,
the delayed resize code can read the destroyed display context.
As a workaround, this commit will destroy the display context at the
earlier timing of the shutdown process.
This commit is contained in:
parent
fd502cbd4d
commit
dfce9b929a
@ -5128,6 +5128,16 @@ void OBSBasic::closeEvent(QCloseEvent *event)
|
||||
|
||||
closing = true;
|
||||
|
||||
/* While closing, a resize event to OBSQTDisplay could be triggered.
|
||||
* The graphics thread on macOS dispatches a lambda function to be
|
||||
* executed asynchronously in the main thread. However, the display is
|
||||
* sometimes deleted before the lambda function is actually executed.
|
||||
* To avoid such a case, destroy displays earlier than others such as
|
||||
* deleting browser docks. */
|
||||
ui->preview->DestroyDisplay();
|
||||
if (program)
|
||||
program->DestroyDisplay();
|
||||
|
||||
if (outputHandler->VirtualCamActive())
|
||||
outputHandler->StopVirtualCam();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user