summaryrefslogtreecommitdiff
path: root/plugins/YAPP/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-01 18:16:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-01 18:16:04 +0000
commitc97a1472f85733e0cf4f3423af6647ff2fa00520 (patch)
tree61a37070d96d8ea98abacee9a58418ea2915d6e0 /plugins/YAPP/src/services.cpp
parent686046823acca19e390051ca1b3decf7d001d117 (diff)
crash fix for YAPP (on exit)
git-svn-id: http://svn.miranda-ng.org/main/trunk@7023 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAPP/src/services.cpp')
-rw-r--r--plugins/YAPP/src/services.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 7d374a7dde..2dd4d83332 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -42,6 +42,9 @@ void StripBBCodesInPlace(wchar_t *text)
static INT_PTR CreatePopup(WPARAM wParam, LPARAM lParam)
{
+ if (bShutdown)
+ return -1;
+
POPUPDATA *pd_in = (POPUPDATA *)wParam;
if ( NotifyEventHooks(hEventNotify, (WPARAM)pd_in->lchContact, (LPARAM)pd_in->PluginWindowProc))
return 0;
@@ -80,6 +83,9 @@ static INT_PTR CreatePopup(WPARAM wParam, LPARAM lParam)
static INT_PTR CreatePopupW(WPARAM wParam, LPARAM lParam)
{
+ if (bShutdown)
+ return -1;
+
POPUPDATAW *pd_in = (POPUPDATAW *)wParam;
if ( NotifyEventHooks(hEventNotify, (WPARAM)pd_in->lchContact, (LPARAM)pd_in->PluginWindowProc))
return 0;
@@ -207,7 +213,8 @@ void UpdateMenu()
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, isEnabled ? TTBST_PUSHED : TTBST_RELEASED);
}
-INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam) {
+INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam)
+{
switch(wParam) {
case PUQS_ENABLEPOPUPS:
{
@@ -244,6 +251,9 @@ static INT_PTR TogglePopups(WPARAM wParam, LPARAM lParam)
static INT_PTR PopupChangeW(WPARAM wParam, LPARAM lParam)
{
+ if (bShutdown)
+ return -1;
+
HWND hwndPop = (HWND)wParam;
POPUPDATAW *pd_in = (POPUPDATAW *)lParam;
@@ -280,7 +290,10 @@ static INT_PTR PopupChangeW(WPARAM wParam, LPARAM lParam)
static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
{
- if ( db_get_b(0, MODULE, "Enabled", 1)) {
+ if (bShutdown)
+ return -1;
+
+ if (db_get_b(0, MODULE, "Enabled", 1)) {
POPUPDATAT pd = {0};
_tcscpy(pd.lptzContactName, lParam == SM_WARNING ? _T("Warning") : _T("Notification"));
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
@@ -292,7 +305,10 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
static INT_PTR ShowMessageW(WPARAM wParam, LPARAM lParam)
{
- if ( db_get_b(0, MODULE, "Enabled", 1)) {
+ if (bShutdown)
+ return -1;
+
+ if (db_get_b(0, MODULE, "Enabled", 1)) {
POPUPDATAW pd = {0};
wcscpy(pd.lpwzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);