X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=inline;f=src%2Fplugins%2FSdiWindow%2Fsdiwindow.cpp;h=02de43a320a80ecf231a3b51d7305e93905764b5;hb=8e0779e2e5a9f947f79c28e2ff121f6ffdd78b3f;hp=4be6efe4f333b9b075db4e6dbdd6e2f52a38ccf5;hpb=1cac301bb12de664bd7e7ec59b78e7dfaf04f6d1;p=evaf
diff --git a/src/plugins/SdiWindow/sdiwindow.cpp b/src/plugins/SdiWindow/sdiwindow.cpp
index 4be6efe..02de43a 100644
--- a/src/plugins/SdiWindow/sdiwindow.cpp
+++ b/src/plugins/SdiWindow/sdiwindow.cpp
@@ -94,8 +94,11 @@ void MainWindow::done()
close();
// Delete all the items added to the main window
- while (mItemsAdded.count() > 0)
- delete mItemsAdded.takeAt(0);
+ while (mItemsAdded.count() > 0) {
+ QWeakPointer item = mItemsAdded.takeAt(0);
+ if (!item.isNull())
+ delete item.data();
+ }
EVAF_INFO("%s finalized", qPrintable(objectName()));
}