From c266152f2766961031a4938bdd62dad1a2135ab9 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 5 Sep 2015 11:43:00 +0000 Subject: Toaster: code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@15268 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 5 +++-- plugins/Toaster/src/toast_event_handler.cpp | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index d2d9148c66..cfb9e3c5c3 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -167,6 +167,7 @@ static INT_PTR UnRegisterClass(WPARAM, LPARAM lParam) { delete it->second; mp_Classes.erase(it); + break; } } return 0; @@ -174,11 +175,11 @@ static INT_PTR UnRegisterClass(WPARAM, LPARAM lParam) void CleanupClasses() { - for (auto it = mp_Classes.begin(); it != mp_Classes.end(); it++) + for (auto it = mp_Classes.begin(); it != mp_Classes.end(); ++it) { delete it->second; - mp_Classes.erase(it); } + mp_Classes.clear(); } static INT_PTR PopupQuery(WPARAM wParam, LPARAM) diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp index a3240b1490..4f3d5e91f9 100644 --- a/plugins/Toaster/src/toast_event_handler.cpp +++ b/plugins/Toaster/src/toast_event_handler.cpp @@ -53,24 +53,21 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification * /*sender*/, _ if (_callback != nullptr) _callback(_arg); - callbackArg *cb = (callbackArg*)_arg; mir_cslock lck(csNotifications); - lstNotifications.remove(cb->notification); + lstNotifications.remove(((callbackArg*)_arg)->notification); return S_OK; } IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification* /* sender */, _In_ IToastDismissedEventArgs* /*e*/) { - callbackArg *cb = (callbackArg*)_arg; mir_cslock lck(csNotifications); - lstNotifications.remove(cb->notification); + lstNotifications.remove(((callbackArg*)_arg)->notification); return S_OK; } IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification* /* sender */, _In_ IToastFailedEventArgs* /*e*/ ) { - callbackArg *cb = (callbackArg*)_arg; mir_cslock lck(csNotifications); - lstNotifications.remove(cb->notification); + lstNotifications.remove(((callbackArg*)_arg)->notification); return S_OK; } \ No newline at end of file -- cgit v1.2.3