From 54c499be356449adfba900116fb264113cbd6c7f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 29 Oct 2023 15:16:04 +0300 Subject: SmileyAdd: fix for occasional crash on exit --- plugins/SmileyAdd/src/main.cpp | 3 ++- plugins/SmileyAdd/src/smileys.cpp | 6 ++++++ plugins/SmileyAdd/src/stdafx.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'plugins') 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); -- cgit v1.2.3