summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2016-10-24 13:49:41 -0700
committerMorten Johan Sørvig <morten.sorvig@qt.io>2016-10-28 12:13:38 +0000
commitf9280ba45ed6e492871cd25026a1bce7a17042dc (patch)
treec1cc2911511bfcfb6a90b4e3affb0280ff7a789a /src/plugins
parentaf3e697ad60358d5a68b8692ee4d2e4f92ab65f8 (diff)
QNSColorPanelDelegate: Don't restore stolen view on dealloc
We may not be playing nice with Cocoa's internals when we decide to reparent NSColorPanel's contents to add QColorDialog's own OK/Cancel buttons. In order to reduce issues, we should avoid poking at things during the application's shutdown sequence. Simply releasing the stolen view should be enough at that point. A similar pattern exists in QNSFontPanelDelegate. Change-Id: I678c236e0c57c4d08a1109a479d965f924288c54 Task-number: QTBUG-56448 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index ed17ef8fe9..3c924bec94 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -116,7 +116,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
- (void)dealloc
{
- [self restoreOriginalContentView];
+ [mStolenContentView release];
[mColorPanel setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index d1802fe4f9..5b27dc1da9 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -144,7 +144,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
- (void)dealloc
{
- [self restoreOriginalContentView];
+ [mStolenContentView release];
[mFontPanel setDelegate:nil];
[[NSFontManager sharedFontManager] setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];