summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/Application')
-rw-r--r--SwifTools/Application/CocoaApplication.h6
-rw-r--r--SwifTools/Application/CocoaApplication.mm10
2 files changed, 11 insertions, 5 deletions
diff --git a/SwifTools/Application/CocoaApplication.h b/SwifTools/Application/CocoaApplication.h
index a3e281c..4b366c6 100644
--- a/SwifTools/Application/CocoaApplication.h
+++ b/SwifTools/Application/CocoaApplication.h
@@ -1,11 +1,13 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
namespace Swift {
class CocoaApplication {
public:
@@ -14,6 +16,6 @@ namespace Swift {
private:
class Private;
- Private* d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/SwifTools/Application/CocoaApplication.mm b/SwifTools/Application/CocoaApplication.mm
index f879014..f058ed4 100644
--- a/SwifTools/Application/CocoaApplication.mm
+++ b/SwifTools/Application/CocoaApplication.mm
@@ -1,3 +1,9 @@
+/*
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <SwifTools/Application/CocoaApplication.h>
#include <AppKit/AppKit.h>
@@ -10,15 +16,13 @@ class CocoaApplication::Private {
NSAutoreleasePool* autoReleasePool_;
};
-CocoaApplication::CocoaApplication() {
- d = new CocoaApplication::Private();
+CocoaApplication::CocoaApplication() : d(new Private()) {
NSApplicationLoad();
d->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
}
CocoaApplication::~CocoaApplication() {
[d->autoReleasePool_ release];
- delete d;
}
}