summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-12 11:17:06 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-12 11:17:06 +0000
commitc9dfef255429860a87b96c44fc40683ad00fa676 (patch)
treedc4ccaab5b8c4e0de0e00b2fba178a9020025fd2 /plugins/Toaster
parentea29a3d7e39e364627a875a3aff1d18cc54b0e15 (diff)
Toaster: fixed memleaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@15334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster')
-rw-r--r--plugins/Toaster/src/services.cpp15
1 files changed, 6 insertions, 9 deletions
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;
}
}