diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-02-02 15:39:40 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-02-06 08:13:58 (GMT) |
commit | 2917f88e64aedeb7a1accfe98b0130c0244b7e3e (patch) | |
tree | 84a10e26b8d4217d12ca46e04d945ef72fc23d74 | |
parent | 6ab0df5ccf8d1ca94e43a52f0c336c6815d1fb84 (diff) | |
download | Qt-2917f88e64aedeb7a1accfe98b0130c0244b7e3e.zip Qt-2917f88e64aedeb7a1accfe98b0130c0244b7e3e.tar.gz Qt-2917f88e64aedeb7a1accfe98b0130c0244b7e3e.tar.bz2 |
Avoids a possible crash when saving the state of a main window
The crash could appear when saving the state of the main window in
response to the visibilityChanged of the dock widgets.
Task-number: QTBUG-7838
Reviewed-by: ogoffart
(cherry picked from commit 3d2dbeb65089efaff4b92b7d13c13c1a234f71b0)
-rw-r--r-- | src/gui/widgets/qmainwindowlayout.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index e455574..e17e7ad 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -1627,6 +1627,13 @@ void QMainWindowLayout::animationFinished(QWidget *widget) tb->d_func()->plug(currentGapRect); #endif + savedState.clear(); + currentGapPos.clear(); + pluggingWidget = 0; + //applying the state will make sure that the currentGap is updated correctly + //and all the geometries (especially the one from the central widget) is correct + layoutState.apply(false); + #ifndef QT_NO_DOCKWIDGET #ifndef QT_NO_TABBAR if (qobject_cast<QDockWidget*>(widget) != 0) { @@ -1637,13 +1644,6 @@ void QMainWindowLayout::animationFinished(QWidget *widget) } #endif #endif - - savedState.clear(); - currentGapPos.clear(); - pluggingWidget = 0; - //applying the state will make sure that the currentGap is updated correctly - //and all the geometries (especially the one from the central widget) is correct - layoutState.apply(false); } if (!widgetAnimator.animating()) { |