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
2023-08-15 13:22:40 +09:00
parent fa17168ba2
commit fd502cbd4d
3 changed files with 44 additions and 5 deletions

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());