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 <thomas.mcguire@kdab.com>
This commit is contained in:
Rafael Roquetto 2012-09-27 19:18:16 -03:00 committed by The Qt Project
parent 928fc8d939
commit 72d7a833bd

View File

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