From 84756e043fa2bd9c83b24abffb280290ad3667cd Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 30 Jun 2010 16:10:59 +0200 Subject: 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 --- src/gui/kernel/qwidget_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index a9bb691..e57ec77 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2861,9 +2861,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 } -- cgit v0.12