summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-31 05:57:41 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-31 05:57:41 +0000
commit081f1880ea898bba1bfd2ba2ff79b5e4de929b86 (patch)
treeeeed45cf1709ac0f2d5109934d03019c5413e02a
parentce10ea25b750f23c558a5920cd2b21d00212776a (diff)
Toaster: fixed memleak, added CoInitialize call
git-svn-id: http://svn.miranda-ng.org/main/trunk@15123 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Toaster/src/main.cpp5
-rw-r--r--plugins/Toaster/src/services.cpp4
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp
index 72fe21d1fc..39f4c549b7 100644
--- a/plugins/Toaster/src/main.cpp
+++ b/plugins/Toaster/src/main.cpp
@@ -40,6 +40,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+
+ CoInitialize(NULL);
+
HookEvent(ME_SYSTEM_PRESHUTDOWN, &OnPreShutdown);
InitServices();
@@ -56,6 +59,8 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
+ CoUninitialize();
+
return 0;
}
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index 3369a2ffb8..689dabae4a 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -104,11 +104,13 @@ static void ShowToastNotification(TCHAR* text, TCHAR* title, MCONTACT hContact)
}
else
{
-#ifdef _DEBUG
+ OutputDebugStringA(CMStringA(FORMAT, "Toaster error: HRESULT = %lld", hr));
+#ifdef _DEBUG
DebugBreak();
#else
Netlib_Logf(NULL, "Toaster: " __FUNCTION__ " failed: HRESULT = %lld", hr);
#endif
+ delete arg->notification;
}
}