summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Toaster')
-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;
}
}