From 72d7a833bd6cd2074f45c1ea32986d498b6dd476 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Thu, 27 Sep 2012 19:18:16 -0300 Subject: [PATCH] QNX: use assert on QQnxWindow destructor This makes it clear that the m_childWindows size must be 0 at this point, indicating otherwise an inconsistency in the logic of the child windows management. Change-Id: I04e418bc6e1d23681bd96f4d619cde9645dc6a22 Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxwindow.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 2d72c75178..393840e8c6 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -147,6 +147,10 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) QQnxWindow::~QQnxWindow() { qWindowDebug() << Q_FUNC_INFO << "window =" << window(); + + // Qt should have already deleted the children before deleting the parent. + Q_ASSERT(m_childWindows.size() > 0); + // Remove from plugin's window mapper QQnxIntegration::removeWindow(m_window); @@ -154,11 +158,6 @@ QQnxWindow::~QQnxWindow() removeFromParent(); m_screen->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 (m_childWindows.size() > 0) - qFatal("QQnxWindow: window destroyed before children!"); - // Cleanup QNX window and its buffers screen_destroy_window(m_window); }