summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-01-14 10:02:54 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2011-01-14 10:02:54 (GMT)
commit94cedb692a1f6fbaae2ff0b96a7e50512ac6f215 (patch)
tree7b09dec2a2e0f37da8b5c6bc82bd11e1d984a7c5 /src/gui/widgets
parent6c52715202ad8fd3c3f4bb94207cb7627c12f995 (diff)
downloadQt-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.cpp13
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