diff options
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.h | 4 | ||||
-rw-r--r-- | SwifTools/Notifier/GrowlNotifier.mm | 3 | ||||
-rw-r--r-- | SwifTools/Notifier/NotificationCenterNotifier.h | 3 | ||||
-rw-r--r-- | SwifTools/Notifier/NotificationCenterNotifier.mm | 3 |
4 files changed, 7 insertions, 6 deletions
diff --git a/SwifTools/Notifier/GrowlNotifier.h b/SwifTools/Notifier/GrowlNotifier.h index cbfe3e9..1b5f191 100644 --- a/SwifTools/Notifier/GrowlNotifier.h +++ b/SwifTools/Notifier/GrowlNotifier.h @@ -6,6 +6,8 @@ #pragma once +#include <memory> + #include <boost/filesystem/fstream.hpp> #include <SwifTools/Notifier/Notifier.h> @@ -36,6 +38,6 @@ namespace Swift { private: class Private; - std::shared_ptr<Private> p; + const std::unique_ptr<Private> p; }; } diff --git a/SwifTools/Notifier/GrowlNotifier.mm b/SwifTools/Notifier/GrowlNotifier.mm index 1356805..4ca53f7 100644 --- a/SwifTools/Notifier/GrowlNotifier.mm +++ b/SwifTools/Notifier/GrowlNotifier.mm @@ -32,8 +32,7 @@ class GrowlNotifier::Private { boost::intrusive_ptr<GrowlNotifierDelegate> delegate; }; -GrowlNotifier::GrowlNotifier(const std::string& name) { - p = std::make_shared<Private>(); +GrowlNotifier::GrowlNotifier(const std::string& name) : p(new Private()){ p->delegate = boost::intrusive_ptr<GrowlNotifierDelegate>([[GrowlNotifierDelegate alloc] init], false); p->delegate.get().notifier = this; p->delegate.get().name = std2NSString(name); diff --git a/SwifTools/Notifier/NotificationCenterNotifier.h b/SwifTools/Notifier/NotificationCenterNotifier.h index 19eb944..838971c 100644 --- a/SwifTools/Notifier/NotificationCenterNotifier.h +++ b/SwifTools/Notifier/NotificationCenterNotifier.h @@ -6,6 +6,7 @@ #pragma once +#include <memory> #include <string> #include <SwifTools/Notifier/Notifier.h> @@ -32,7 +33,7 @@ public: private: class Private; - std::shared_ptr<Private> p; + const std::unique_ptr<Private> p; }; } diff --git a/SwifTools/Notifier/NotificationCenterNotifier.mm b/SwifTools/Notifier/NotificationCenterNotifier.mm index 35c740a..1538186 100644 --- a/SwifTools/Notifier/NotificationCenterNotifier.mm +++ b/SwifTools/Notifier/NotificationCenterNotifier.mm @@ -39,8 +39,7 @@ class NotificationCenterNotifier::Private { boost::intrusive_ptr<NotificationCenterNotifierDelegate> delegate; }; -NotificationCenterNotifier::NotificationCenterNotifier() { - p = std::make_shared<Private>(); +NotificationCenterNotifier::NotificationCenterNotifier() : p(new Private()) { p->delegate = boost::intrusive_ptr<NotificationCenterNotifierDelegate>([[NotificationCenterNotifierDelegate alloc] init], false); [p->delegate.get() setNotifier: this]; |