diff options
author | Frank Reininghaus <frank78ac@googlemail.com> | 2009-08-26 18:49:32 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-27 08:01:08 (GMT) |
commit | 8ac7e812604d24fcbf28132a611d3b3e06120349 (patch) | |
tree | 82051d86764e6483815654e9ddfb2ecf58831c8d /src/gui/widgets | |
parent | 4de2a2241e9e1c5f29223d6bd0616e6db77be70e (diff) | |
download | Qt-8ac7e812604d24fcbf28132a611d3b3e06120349.zip Qt-8ac7e812604d24fcbf28132a611d3b3e06120349.tar.gz Qt-8ac7e812604d24fcbf28132a611d3b3e06120349.tar.bz2 |
Do not crash when double-clicking a tab in a QTabBar with movable tabs
Check if QTabBarPrivate's movingTab member is 0 before dereferencing it.
This fixes a crash when double-clicking a tab. New unit test included.
http://bugs.kde.org/show_bug.cgi?id=202767
Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Merge-Request: 1337
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qtabbar.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 5166390..d8246c8 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1836,7 +1836,8 @@ void QTabBarPrivate::moveTabFinished(int index) } #endif //QT_NO_ANIMATION if (allAnimationsFinished && 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; } |