src/gui/widgets/qmainwindowlayout_mac.mm
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 5 d3bac044e0f0
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   474 {
   474 {
   475     for (int i = 0; i < toolbarItemsCopy.size(); ++i)
   475     for (int i = 0; i < toolbarItemsCopy.size(); ++i)
   476         CFRelease(toolbarItemsCopy.at(i));
   476         CFRelease(toolbarItemsCopy.at(i));
   477     toolbarItemsCopy.clear();
   477     toolbarItemsCopy.clear();
   478     unifiedToolbarHash.clear();
   478     unifiedToolbarHash.clear();
       
   479 
       
   480 #ifdef QT_MAC_USE_COCOA
       
   481     QMacCocoaAutoReleasePool pool;
       
   482 
       
   483     OSWindowRef window = qt_mac_window_for(layoutState.mainWindow);
       
   484     NSToolbar *macToolbar = [window toolbar];
       
   485     if (macToolbar) {
       
   486       [[macToolbar delegate] release];
       
   487       [macToolbar setDelegate:nil];
       
   488     }
       
   489 #endif
   479 }
   490 }
   480 
   491 
   481 void QMainWindowLayout::fixSizeInUnifiedToolbar(QToolBar *tb) const
   492 void QMainWindowLayout::fixSizeInUnifiedToolbar(QToolBar *tb) const
   482 {
   493 {
   483 #ifdef QT_MAC_USE_COCOA
   494 #ifdef QT_MAC_USE_COCOA