Browse Source

UI: Fix handling of remove signal with projectors

Since the remove signal is coming from another thread,
QMetaObject::invokeMethod has to be used, or corruption
could possibly occur.
cg2121 3 years ago
parent
commit
66341c7568
1 changed files with 1 additions and 5 deletions
  1. 1 5
      UI/window-projector.cpp

+ 1 - 5
UI/window-projector.cpp

@@ -665,11 +665,7 @@ void OBSProjector::OBSRender(void *data, uint32_t cx, uint32_t cy)
 void OBSProjector::OBSSourceRemoved(void *data, calldata_t *params)
 {
 	OBSProjector *window = reinterpret_cast<OBSProjector *>(data);
-
-	OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
-	main->DeleteProjector(window);
-	allProjectors.removeAll(window);
-
+	QMetaObject::invokeMethod(window, "EscapeTriggered");
 	UNUSED_PARAMETER(params);
 }