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:
parent
928fc8d939
commit
72d7a833bd
@ -147,6 +147,10 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
|
|||||||
QQnxWindow::~QQnxWindow()
|
QQnxWindow::~QQnxWindow()
|
||||||
{
|
{
|
||||||
qWindowDebug() << Q_FUNC_INFO << "window =" << window();
|
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
|
// Remove from plugin's window mapper
|
||||||
QQnxIntegration::removeWindow(m_window);
|
QQnxIntegration::removeWindow(m_window);
|
||||||
|
|
||||||
@ -154,11 +158,6 @@ QQnxWindow::~QQnxWindow()
|
|||||||
removeFromParent();
|
removeFromParent();
|
||||||
m_screen->updateHierarchy();
|
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
|
// Cleanup QNX window and its buffers
|
||||||
screen_destroy_window(m_window);
|
screen_destroy_window(m_window);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user