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
commit fd502cbd4d
No known key found for this signature in database
GPG key ID: 4E8FB3A36F297EC2
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());