• Gunnar Sletta's avatar
    Fix cleanup of non-threaded render loops. · c2706491
    Gunnar Sletta authored
    
    They would unconditionally call cleanupNodesOnShutdown on hide(), but
    QQuickWindow::sceneGraphInvalidated would only be emitted if this was
    the last window being hidden, leading to an inconsistent state in the
    application.
    
    Since the non-threaded render loops do not support releasing resources
    (there is one OpenGL context and one QSGRenderContext shared between
    all windows) we delay cleanup until the window is destroyed.
    
    This change also make the render loops track the windows until they
    are destroyed, similar to what the threaded one does. The purpose of
    this is to, in the case of dangling windows, only trigger invalidation
    of the scene graph when the last QQuickWindow is destroyed through
    QSGRenderLoop::cleanup().
    
    Task-number: QTBUG-41210
    Change-Id: I7e12a4f726ebb3e7935c822b6046abb3590c583a
    Reviewed-by: default avatarUlf Hermann <ulf.hermann@digia.com>
    Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@digia.com>
    c2706491