From b42b00a36b5b48bffcbccc9b1c7ecafa89b4e18e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 28 Aug 2009 14:42:57 +0200 Subject: Fixes: Crash when double-clicking a tab in a QTabBar with movable tabs This is a backport of commit 8ac7e81260 Reviewed-by: Peter Hartmann --- src/gui/widgets/qtabbar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index bd45379..bdc804c 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1844,7 +1844,8 @@ void QTabBarPrivate::_q_moveTabFinished(int index) Q_Q(QTabBar); bool cleanup = (pressedIndex == index) || (pressedIndex == -1) || !validIndex(index); if (animations.isEmpty() && cleanup) { - movingTab->setVisible(false); // We might not get a mouse release + if (movingTab) + movingTab->setVisible(false); // We might not get a mouse release for (int i = 0; i < tabList.count(); ++i) { tabList[i].dragOffset = 0; } -- cgit v0.12