From 752b3c8dfc49974b3570a3ca272ff5ef6945c6f4 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 3 Oct 2015 19:24:25 +0000 Subject: Toaster: crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@15505 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'plugins/Toaster/src/services.cpp') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index d930426906..3f701b86f9 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -261,7 +261,16 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) static INT_PTR HideToast(WPARAM, LPARAM lParam) { - static_cast(reinterpret_cast(lParam)->GetToastNotification())->Hide(); + extern LIST lstHandlers; + ToastEventHandler* handler = reinterpret_cast(lParam); + if (lstHandlers.getIndex(handler) != -1) + { + ToastNotification* notification = static_cast(handler->GetToastNotification()); + if (lstNotifications.getIndex(notification) != -1) + { + notification->Hide(); + } + } return 0; } void __stdcall HideAllToasts(void*) -- cgit v1.2.3