UI: Fix crash at render_display while shutdown on macOS

The display context was sometimes created again by a resize event after
destruction from `OBSBasic::closeEvent`. That resulted in the display
context alive until reaching the destructor of the `OBSQTDisplay` class
and caused a crash in `render_display` on macOS. To avoid this, destroy
the display context at the event `SurfaceAboutToBeDestroyed` and let not
create the display context again.
This commit is contained in:
Norihiro Kamae committed 2023-08-15 13:40:09 +09:00
1 parent fa17168ba2
commit fd502cbd4d
3 files changed
+44 -5

No files matched your search

-4
View File
@@ -5154,10 +5154,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());