diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2011-01-14 10:02:54 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2011-01-14 10:02:54 (GMT) |
commit | 94cedb692a1f6fbaae2ff0b96a7e50512ac6f215 (patch) | |
tree | 7b09dec2a2e0f37da8b5c6bc82bd11e1d984a7c5 /src/gui/widgets | |
parent | 6c52715202ad8fd3c3f4bb94207cb7627c12f995 (diff) | |
download | Qt-94cedb692a1f6fbaae2ff0b96a7e50512ac6f215.zip Qt-94cedb692a1f6fbaae2ff0b96a7e50512ac6f215.tar.gz Qt-94cedb692a1f6fbaae2ff0b96a7e50512ac6f215.tar.bz2 |
Free memory when disabling the unified toolbar.
Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index da902d5..214cf05 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1526,12 +1526,23 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) #ifdef QT_MAC_USE_COCOA // Activate the unified toolbar with the raster engine. - if (windowSurface()) { + if (windowSurface() && set) { d->layout->unifiedSurface = new QUnifiedToolbarSurface(this); } #endif // QT_MAC_USE_COCOA d->layout->updateHIToolBarStatus(); + +#ifdef QT_MAC_USE_COCOA + // Deactivate the unified toolbar with the raster engine. + if (windowSurface() && !set) { + if (d->layout->unifiedSurface) { + delete d->layout->unifiedSurface; + d->layout->unifiedSurface = 0; + } + } +#endif // QT_MAC_USE_COCOA + // Enabling the unified toolbar clears the opaque size grip setting, update it. d->macUpdateOpaqueSizeGrip(); #else |