From c9dfef255429860a87b96c44fc40683ad00fa676 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 12 Sep 2015 11:17:06 +0000 Subject: Toaster: fixed memleaks git-svn-id: http://svn.miranda-ng.org/main/trunk@15334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index c7dbf2367c..81d737525a 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -13,10 +13,8 @@ void __stdcall ShowToastNotification(void* p) return; ptrT imagePath; - callbackArg *arg = (callbackArg*)mir_calloc(sizeof(callbackArg)); if (td->hContact != NULL && td->hContact != INVALID_CONTACT_ID) { - arg->hContact = td->hContact; const char* szProto = GetContactProto(td->hContact); if (ProtoServiceExists(szProto, PS_GETAVATARINFO)) @@ -48,24 +46,23 @@ void __stdcall ShowToastNotification(void* p) } } - arg->notification = new ToastNotification(td->tszText, td->tszTitle, imagePath); + ToastNotification *notification = new ToastNotification(td->tszText, td->tszTitle, imagePath); - HRESULT hr = arg->notification->Initialize(); + HRESULT hr = notification->Initialize(); if (SUCCEEDED(hr)) { ToastHandlerData *thd = new ToastHandlerData(); thd->hContact = td->hContact; thd->vPopupData = td->vPopupData; thd->pPopupProc = td->pPopupProc; - thd->tstNotification = arg->notification; + thd->tstNotification = notification; - arg->notification->Show(new ToastEventHandler(thd)); - lstNotifications.insert(arg->notification); + notification->Show(new ToastEventHandler(thd)); + lstNotifications.insert(notification); } else { - delete arg->notification; - mir_free(arg); + delete notification; } } -- cgit v1.2.3