summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-29 15:16:04 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-29 15:16:04 +0300
commit54c499be356449adfba900116fb264113cbd6c7f (patch)
treea33ffd18abc501eec4efbf1c77e7844f0b055fbb /plugins/SmileyAdd/src
parent29407ee1ab79789842fb274b1ed7ac4be83d7d67 (diff)
SmileyAdd: fix for occasional crash on exit
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/main.cpp3
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp6
-rw-r--r--plugins/SmileyAdd/src/stdafx.h2
3 files changed, 10 insertions, 1 deletions
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index 8f18584071..4525fb6e7c 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -150,6 +150,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
static int MirandaShutdown(WPARAM, LPARAM)
{
CloseSmileys();
+ DestroyProxyWindow();
return 0;
}
@@ -165,7 +166,7 @@ int CMPlugin::Load()
g_hevOptionsChanged = CreateHookableEvent(ME_SMILEYADD_OPTIONSCHANGED);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, MirandaShutdown);
+ HookEvent(ME_SYSTEM_SHUTDOWN, MirandaShutdown);
HookEvent(ME_OPT_INITIALISE, SmileysOptionsInitialize);
HookEvent(ME_SMILEYADD_OPTIONSCHANGED, UpdateSrmmDlg);
HookEvent(ME_PROTO_ACCLISTCHANGED, AccountListChanged);
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 90b374ea56..8c0c5dfe02 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -47,6 +47,12 @@ static void CALLBACK sttStopTimer(PVOID obj)
KillTimer(hwndHidden, (DWORD_PTR)obj);
}
+void DestroyProxyWindow()
+{
+ if (hwndHidden)
+ DestroyWindow(hwndHidden);
+}
+
//
// SmileyType
//
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h
index 7db517fc71..5c2942f5ec 100644
--- a/plugins/SmileyAdd/src/stdafx.h
+++ b/plugins/SmileyAdd/src/stdafx.h
@@ -140,6 +140,8 @@ void SetRichOwnerCallback(HWND hwnd, HWND hwndInput, HWND hwndLog);
void ProcessAllInputAreas(bool restoreText);
void RichEditData_Destroy(void);
+void DestroyProxyWindow();
+
void CloseSmileys(void);
int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt);