summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/toast_event_handler.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-25 18:47:53 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-25 18:47:53 +0000
commitc888cdec61b7c3fdf164b15841b6aa148f0148d5 (patch)
treed39082ace48565e27412f02aeace1b00d2719804 /plugins/Toaster/src/toast_event_handler.cpp
parent65c13e2c1fe1c205ac6c5e0062a6a99389fc9af0 (diff)
Toaster: crash fix; check in options for enable/disable
git-svn-id: http://svn.miranda-ng.org/main/trunk@15443 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/toast_event_handler.cpp')
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index a5b11705cc..5b1bdaf1f5 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -13,8 +13,6 @@ ToastEventHandler::~ToastEventHandler()
{
if (_thd->pPopupProc)
_thd->pPopupProc((HWND)this, UM_FREEPLUGINDATA, 0, 0);
-
- lstNotifications.remove(_thd->tstNotification);
}
IFACEMETHODIMP_(ULONG) ToastEventHandler::AddRef()
@@ -51,8 +49,7 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IInspect
if (_thd->pPopupProc)
_thd->pPopupProc((HWND)this, WM_COMMAND, 0, 0);
- mir_cslock lck(csNotifications);
- lstNotifications.remove(_thd->tstNotification);
+ DestroyNotification();
return S_OK;
}
@@ -64,12 +61,6 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IToastDi
switch (tdr)
{
- case ToastDismissalReason_ApplicationHidden:
- {
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
- break;
- }
case ToastDismissalReason_UserCanceled:
{
if (_thd->pPopupProc)
@@ -77,21 +68,25 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IToastDi
_thd->tstNotification->Hide();
break;
}
+ case ToastDismissalReason_ApplicationHidden:
case ToastDismissalReason_TimedOut:
+ DestroyNotification();
break;
}
- mir_cslock lck(csNotifications);
- lstNotifications.remove(_thd->tstNotification);
-
return S_OK;
}
IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IToastFailedEventArgs*)
{
+ DestroyNotification();
+ return S_OK;
+}
+
+void ToastEventHandler::DestroyNotification()
+{
mir_cslock lck(csNotifications);
lstNotifications.remove(_thd->tstNotification);
- return S_OK;
}
void* ToastEventHandler::GetPluginData()