diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-05-25 07:30:20 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-05-25 11:41:29 (GMT) |
commit | 58253fafc6d3c0a535833e674d8930a46138c25f (patch) | |
tree | 804d82d2ee1169e2cd3af7779c9188bcdb15b136 /src/gui/dialogs | |
parent | 44d992ca150d9448cb7b9114b2bc489b441c7b76 (diff) | |
download | Qt-58253fafc6d3c0a535833e674d8930a46138c25f.zip Qt-58253fafc6d3c0a535833e674d8930a46138c25f.tar.gz Qt-58253fafc6d3c0a535833e674d8930a46138c25f.tar.bz2 |
BT: Mac: Crash when using QFontDialog
If creating a native QFontDialog and delete it, the native dialog
will still show. And worse, it will call the deleted QDialog
counterpart. This fix will clean up (and close the native dialog)
when the QDialog is deleted.
Task-number: 254397
Reviewed-by: Trenton Schulz
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r-- | src/gui/dialogs/qfontdialog.cpp | 8 | ||||
-rw-r--r-- | src/gui/dialogs/qfontdialog_mac.mm | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index 4c5bf4f..aa1c553 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -337,6 +337,14 @@ void QFontDialogPrivate::init() QFontDialog::~QFontDialog() { +#ifdef Q_WS_MAC + Q_D(QFontDialog); + if (d->delegate) { + QFontDialogPrivate::closeCocoaFontPanel(d->delegate); + QFontDialogPrivate::sharedFontPanelAvailable = true; + return; + } +#endif } /*! diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index 50917a1..13f7149 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -566,6 +566,7 @@ void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial, void QFontDialogPrivate::closeCocoaFontPanel(void *delegate) { + QMacCocoaAutoReleasePool pool; QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate); NSWindow *ourPanel = [theDelegate actualPanel]; [ourPanel close]; |