diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-06-30 14:10:59 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:06:26 (GMT) |
commit | d65ce6fe36e8f453916437fd5237dd7dc88666e2 (patch) | |
tree | ed2f80d85aac63b5d2786661736892f34fa3ea5b | |
parent | 1e6e8e3cf34d766f9076e04e5ca20c829a92df90 (diff) | |
download | Qt-d65ce6fe36e8f453916437fd5237dd7dc88666e2.zip Qt-d65ce6fe36e8f453916437fd5237dd7dc88666e2.tar.gz Qt-d65ce6fe36e8f453916437fd5237dd7dc88666e2.tar.bz2 |
Crash while changing the windows flags from a Qt::Drawer window on Cocoa
The crash was caused while checking the visibility of the toolbar inside
a native cocoa window. There is no toolbar for a drawer window.
Task-number: QTBUG-11138
Reviewed-by: Denis
(cherry picked from commit 84756e043fa2bd9c83b24abffb280290ad3667cd)
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index f005732..d1b92aa 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2767,9 +2767,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) } if (wasWindow) { oldToolbar = [oldWindow toolbar]; - [oldToolbar retain]; - oldToolbarVisible = [oldToolbar isVisible]; - [oldWindow setToolbar:nil]; + if (oldToolbar) { + [oldToolbar retain]; + oldToolbarVisible = [oldToolbar isVisible]; + [oldWindow setToolbar:nil]; + } } #endif } |