summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm13
2 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index dd0c4aedfe..46e8925ba7 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -47,6 +47,7 @@
#include "qcocoaautoreleasepool.h"
#include "qcocoacursor.h"
+#include <QtCore/QScopedPointer>
#include <QtGui/QPlatformIntegration>
QT_BEGIN_NAMESPACE
@@ -90,11 +91,12 @@ public:
QPlatformTheme *platformTheme() const;
private:
- QPlatformFontDatabase *mFontDb;
+
+ QScopedPointer<QPlatformFontDatabase> mFontDb;
QAbstractEventDispatcher *mEventDispatcher;
- QPlatformAccessibility *mAccessibility;
- QPlatformTheme *mPlatformTheme;
+ QScopedPointer<QPlatformAccessibility> mAccessibility;
+ QScopedPointer<QPlatformTheme> mPlatformTheme;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 7d91be776a..685b640843 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -89,6 +89,9 @@ QCocoaScreen::~QCocoaScreen()
QCocoaIntegration::QCocoaIntegration()
: mFontDb(new QCoreTextFontDatabase())
, mEventDispatcher(new QCocoaEventDispatcher())
+ , mAccessibility(new QPlatformAccessibility)
+ , mPlatformTheme(new QCocoaTheme)
+
{
QCocoaAutoReleasePool pool;
@@ -134,13 +137,11 @@ QCocoaIntegration::QCocoaIntegration()
screenAdded(screen);
}
- mAccessibility = new QPlatformAccessibility;
- mPlatformTheme = new QCocoaTheme;
}
QCocoaIntegration::~QCocoaIntegration()
{
- delete mAccessibility;
+ [[NSApplication sharedApplication] setDelegate: 0];
}
bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) const
@@ -177,7 +178,7 @@ QAbstractEventDispatcher *QCocoaIntegration::guiThreadEventDispatcher() const
QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const
{
- return mFontDb;
+ return mFontDb.data();
}
QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const
@@ -187,12 +188,12 @@ QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const
QPlatformAccessibility *QCocoaIntegration::accessibility() const
{
- return mAccessibility;
+ return mAccessibility.data();
}
QPlatformTheme *QCocoaIntegration::platformTheme() const
{
- return mPlatformTheme;
+ return mPlatformTheme.data();
}
QT_END_NAMESPACE