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 65a360fa41
commit 66341c7568

View file

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