summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2011-07-12 17:29:46 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-12 19:59:40 +0200
commit92c4b63ee1751e6b1c9a90eaee76d74c3f0d3a3e (patch)
tree3db9e3a85d80e840949b9f98487eb8759abd5070 /src
parenta8fd5b9d2afea4e8eba271fb658668f15dfb09d7 (diff)
Fix a crash with QGraphicsScene.
It happened when the scene gets deleted after ~QApplication has been called. test case: int main(int argc, char *argv[]) { QApplication a(argc, argv); QGraphicsScene *scene = new QGraphicsScene(&a); return 0; } Change-Id: I74d4023c9575242a2e334b2c786e00d0686c452b Reviewed-on: http://codereview.qt.nokia.com/1544 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 655725b8e9..1551944a09 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1639,7 +1639,8 @@ QGraphicsScene::~QGraphicsScene()
Q_D(QGraphicsScene);
// Remove this scene from qApp's global scene list.
- qApp->d_func()->scene_list.removeAll(this);
+ if (!QApplicationPrivate::is_app_closing)
+ qApp->d_func()->scene_list.removeAll(this);
clear();