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.
This commit is contained in:
cg2121
2022-03-10 02:22:42 -06:00
committed by Jim
parent fb96d637e2
commit 2056a41ca5

View File

@@ -626,11 +626,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);
}