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>
This commit is contained in:
parent
a8fd5b9d2a
commit
92c4b63ee1
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user