mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-24 14:19:11 -05:00
Merge pull request #9435 from norihiro/qtdisplay-destroy-at-surface-event-3
Fix crash at render_display while shutdown on macOS
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -5154,10 +5164,6 @@ void OBSBasic::closeEvent(QCloseEvent *event)
|
||||
|
||||
delete extraBrowsers;
|
||||
|
||||
ui->preview->DestroyDisplay();
|
||||
if (program)
|
||||
program->DestroyDisplay();
|
||||
|
||||
config_set_string(App()->GlobalConfig(), "BasicWindow", "DockState",
|
||||
saveState().toBase64().constData());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user