diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2011-07-12 15:29:46 (GMT) |
---|---|---|
committer | Pierre Rossi <pierre.rossi@nokia.com> | 2011-07-12 15:29:46 (GMT) |
commit | 3d98456fbaae83e504856df8611ccda5a16e8a90 (patch) | |
tree | 74f5287e523c207c241fce77c30ae948322b3f35 | |
parent | 8be3168aa2f300f9a93a53b417704f3f10b1dc8b (diff) | |
download | Qt-3d98456fbaae83e504856df8611ccda5a16e8a90.zip Qt-3d98456fbaae83e504856df8611ccda5a16e8a90.tar.gz Qt-3d98456fbaae83e504856df8611ccda5a16e8a90.tar.bz2 |
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;
}
Reviewed-by: Gabi
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 655725b..1551944 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(); |