summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/toast_event_handler.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 14:41:59 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 14:41:59 +0000
commit030ba2d4e3a9eeeb395b517c1e103912d1d3b0b1 (patch)
treedade4900fc9d36141a122b75d11e0a603341c7dc /plugins/Toaster/src/toast_event_handler.cpp
parentd798d3bd532abf0fc9db8cd73c892303353fcf08 (diff)
Toaster: warnings fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15484 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/toast_event_handler.cpp')
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index e312f7a8e1..a31a0d342b 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -21,8 +21,7 @@ IFACEMETHODIMP_(ULONG) ToastEventHandler::AddRef()
IFACEMETHODIMP_(ULONG) ToastEventHandler::Release()
{
ULONG l = InterlockedDecrement(&_ref);
- if (l == 0)
- delete this;
+ if (l == 0) delete this;
return l;
}
@@ -79,14 +78,17 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IToastFa
void ToastEventHandler::DestroyNotification()
{
- mir_cslock lck(csNotifications);
- lstNotifications.remove(_thd->tstNotification);
+ if (_thd->tstNotification != nullptr)
+ {
+ mir_cslock lck(csNotifications);
+ lstNotifications.remove(_thd->tstNotification);
+ }
+ _thd->tstNotification = nullptr;
}
-void ToastEventHandler::CallPopupProc(UINT uMsg)
+LRESULT ToastEventHandler::CallPopupProc(UINT uMsg)
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, uMsg, 0, 0);
+ return (_thd->pPopupProc ? _thd->pPopupProc((HWND)this, uMsg, 0, 0) : 0);
}
void* ToastEventHandler::GetPluginData()