summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/toast_notification.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-16 12:35:57 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-16 12:35:57 +0000
commitd0a1040e019092c29d8d2a2c2a29bc1e7644a5e5 (patch)
tree9297e79ab09653aa870c5ef83c163673fbce8e6c /plugins/Toaster/src/toast_notification.cpp
parent87208846a0e7fd82e246dd1e6a9cddfc0ca159e4 (diff)
Toaster: more optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@15361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/toast_notification.cpp')
-rw-r--r--plugins/Toaster/src/toast_notification.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp
index 4eb83adca4..02b190a80e 100644
--- a/plugins/Toaster/src/toast_notification.cpp
+++ b/plugins/Toaster/src/toast_notification.cpp
@@ -9,6 +9,9 @@ ToastNotification::ToastNotification(_In_ wchar_t* text, _In_ wchar_t* caption,
ToastNotification::~ToastNotification()
{
+ notification->remove_Activated(ertActivated);
+ notification->remove_Dismissed(ertDismissed);
+ notification->remove_Failed(ertFailed);
}
HRESULT ToastNotification::Initialize()
@@ -79,12 +82,12 @@ HRESULT ToastNotification::Show()
HRESULT ToastNotification::Show(_In_ ToastEventHandler* handler)
{
- EventRegistrationToken activatedToken, dismissedToken, failedToken;
+
ComPtr<ToastEventHandler> eventHandler(handler);
- notification->add_Activated(eventHandler.Get(), &activatedToken);
- notification->add_Dismissed(eventHandler.Get(), &dismissedToken);
- notification->add_Failed(eventHandler.Get(), &failedToken);
+ notification->add_Activated(eventHandler.Get(), &ertActivated);
+ notification->add_Dismissed(eventHandler.Get(), &ertDismissed);
+ notification->add_Failed(eventHandler.Get(), &ertFailed);
return notifier->Show(notification.Get());
}