From 3d2dbeb65089efaff4b92b7d13c13c1a234f71b0 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 2 Feb 2010 16:39:40 +0100 Subject: 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 --- src/gui/widgets/qmainwindowlayout.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index d1e7285..fc75c92 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(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()) { -- cgit v0.12