UI: Delete OBSDisplay on window hide on unix
When a window with an OBSQTDisplay is closed, the surface can be destroyed before the display is, opening a gap for OBS to attempt to draw to the invalid surface. This deletes the underlying OBSDisplay object when the actual surface is destroyed, closing that gap. Note: This appears to have been an issue previously with Wayland, as hinted by the existing ifdefs.master
parent
2fa145899f
commit
44f07f9b11
|
@ -90,9 +90,8 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
|
|||
|
||||
auto windowVisible = [this](bool visible) {
|
||||
if (!visible) {
|
||||
#ifdef ENABLE_WAYLAND
|
||||
if (obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND)
|
||||
display = nullptr;
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
display = nullptr;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue