From 8bff191b32aae36e0f06b3fc7793578125094886 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 21 Dec 2021 01:42:22 -0800 Subject: [PATCH] UI: Use sendPostedEvents with deleteLater events on destroy On destruction of the window, send remaining QEvent::DeferredDelete events just to ensure there are no lingering actions remaining in the queue. May cause additional events to be posted, which should be covered by the final sendPostedEvents call. (Jim note: I admit this is probably unnecessary, and this may be redundant, but the reason such redundant precaution is being taken is because we want to make sure that browser panels in particular are properly cleaned up. To be quite frank I'm adding this mostly out of paranoia.) --- UI/window-basic-main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 51dcd3c86..232c25e52 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -2555,6 +2555,7 @@ OBSBasic::~OBSBasic() { /* clear out UI event queue */ QApplication::sendPostedEvents(nullptr); + QApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); if (updateCheckThread && updateCheckThread->isRunning()) updateCheckThread->wait();