Ver Fonte

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.
tt2468 há 3 anos atrás
pai
commit
44f07f9b11
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      UI/qt-display.cpp

+ 2 - 3
UI/qt-display.cpp

@@ -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;
 		}