From 523e8b2517362d4bbb46042bf7430d34c7ad4578 Mon Sep 17 00:00:00 2001 From: Palana Date: Sun, 28 Jun 2015 02:57:30 +0200 Subject: [PATCH] UI: Explicitly delete source list items in closeEvent This should reduce the chances of any deleteLater objects holding strong references into the libobs core getting stuck in the Qt event queue --- obs/window-basic-main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 5ebe71f10..930c3c45e 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -2023,11 +2023,13 @@ void OBSBasic::closeEvent(QCloseEvent *event) * any ->deleteLater events in this window created by Qt in relation to * their internal data */ ClearVolumeControls(); - ui->sources->clear(); QListWidgetItem *item = nullptr; while ((item = ui->scenes->takeItem(0))) delete item; + + while ((item = ui->sources->takeItem(0))) + delete item; } void OBSBasic::changeEvent(QEvent *event)