From 5267c575d60b9f1f0415e8affbd38c28c4cd3873 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 28 Sep 2012 09:24:24 -0300 Subject: QNX: use assert on QBBWindow destructor This makes it clear that the mChildren size must be 0 at this point, indicating otherwise an inconsistency in the logic of the child windows management. cherry-picked from qt5 72d7a833bd6cd2074f45c1ea32986d498b6dd476 Change-Id: I7c0eb9b1b1121b708badb46bd423de0e75d206a6 Reviewed-by: Giuseppe D'Angelo --- src/plugins/platforms/blackberry/qbbwindow.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/blackberry/qbbwindow.cpp index 04b5ce0..ff66534 100644 --- a/src/plugins/platforms/blackberry/qbbwindow.cpp +++ b/src/plugins/platforms/blackberry/qbbwindow.cpp @@ -138,15 +138,13 @@ QBBWindow::~QBBWindow() qDebug() << "QBBWindow::~QBBWindow - w=" << widget(); #endif + // Qt should have already deleted the children before deleting the parent. + Q_ASSERT(mChildren.size() == 0); + // Remove from parent's Hierarchy. removeFromParent(); mScreen->updateHierarchy(); - // We shouldn't allow this case unless QT allows it. Does it? Or should we send the - // handleCloseEvent on all children when this window is deleted? - if (mChildren.size() > 0) - qFatal("QBBWindow: window destroyed before children!"); - // cleanup OpenGL/OpenVG context if it exists if (mPlatformGlContext != NULL) { delete mPlatformGlContext; -- cgit v0.12