summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2012-09-25 10:57:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 13:22:49 +0200
commit903bd6250affd4209dff4e73c4c46cb69965f5fa (patch)
tree01bed9361f2625d89be67bd8001dad66f70ea224 /src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
parent2570c081a16962867a7fca53547462a6f1ecbb84 (diff)
Cocoa: add missing auto release pools
Got complaints while running file dialog example. Adding in the release pools will fix the problem. Change-Id: Ib33fddd5aedfc3e4aaa6fdd8995bbc8c8098267c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 872a5cb79a..48be019659 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -60,6 +60,7 @@
#include <qvarlengtharray.h>
#include <stdlib.h>
#include <qabstracteventdispatcher.h>
+#include "qcocoaautoreleasepool.h"
#include <qpa/qplatformnativeinterface.h>
@@ -526,6 +527,7 @@ QCocoaFileDialogHelper::~QCocoaFileDialogHelper()
{
if (!mDelegate)
return;
+ QCocoaAutoReleasePool pool;
[reinterpret_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate) release];
mDelegate = 0;
}
@@ -641,6 +643,7 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate()
{
if (mDelegate)
return;
+ QCocoaAutoReleasePool pool;
const SharedPointerFileDialogOptions &opts = options();
const QStringList selectedFiles = opts->initiallySelectedFiles();
const QString directory = opts->initialDirectory();
@@ -688,6 +691,7 @@ void QCocoaFileDialogHelper::exec()
// QEventLoop has been interrupted, and the second-most event loop has not
// yet been reactivated (regardless if [NSApp run] is still on the stack)),
// showing a native modal dialog will fail.
+ QCocoaAutoReleasePool pool;
QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
if ([delegate runApplicationModalPanel])
emit accept();