summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-12 11:09:06 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-12 11:09:06 +0000
commit32371d614e689579e9f8fd017ad122cdbc3442e6 (patch)
tree04c523a8d86b70fa8273127facff272308120d74 /plugins/Toaster
parentaa2f5ce19e9565fd7d1944408f6feb2f089b5d44 (diff)
Toaster: potential crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster')
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index 63bef5e766..81fd2aae1d 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -9,6 +9,8 @@ ToastEventHandler::ToastEventHandler() : _ref(1)
ToastEventHandler::ToastEventHandler(_In_ ToastHandlerData *pData) : _ref(1), _thd(pData)
{
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, UM_INITPOPUP, 0, 0);
}
ToastEventHandler::~ToastEventHandler()
@@ -53,14 +55,16 @@ IFACEMETHODIMP ToastEventHandler::QueryInterface(_In_ REFIID riid, _COM_Outptr_
IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification * /*sender*/, _In_ IInspectable* /*args*/)
{
- _thd->pPopupProc((HWND)this, WM_COMMAND, 0, 0);
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, WM_COMMAND, 0, 0);
delete this;
return S_OK;
}
IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification* /* sender */, _In_ IToastDismissedEventArgs* /*e*/)
{
- _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
_thd->tstNotification->Hide();
delete this;
return S_OK;