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.)
This commit is contained in:
jp9000 2021-12-21 01:42:22 -08:00
parent fb58e58892
commit 8bff191b32

View file

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