From 66fa09f8dc58870f6fe52e65f524381c7a782fbc Mon Sep 17 00:00:00 2001 From: Goraf Date: Sat, 6 Feb 2016 18:40:38 +0000 Subject: ContextHelp: fix handle leak git-svn-id: http://svn.miranda-ng.org/main/trunk@16229 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ContextHelp/src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins/ContextHelp') diff --git a/plugins/ContextHelp/src/main.cpp b/plugins/ContextHelp/src/main.cpp index b72edee83f..1a8af0611a 100644 --- a/plugins/ContextHelp/src/main.cpp +++ b/plugins/ContextHelp/src/main.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" HINSTANCE hInst; +HMODULE hMsftEdit; + extern HWND hwndHelpDlg; int hLangpack; @@ -94,11 +96,14 @@ extern "C" __declspec(dllexport) int Load(void) if (!InitCommonControlsEx(&icc)) return 1; - if (LoadLibrary(_T("Msftedit.dll")) == NULL) + hMsftEdit = LoadLibrary(_T("Msftedit.dll")); + if (hMsftEdit == NULL) { if (IDYES != MessageBoxEx(NULL, TranslateT("The Context help plugin can not be loaded, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), TranslateT("Context help plugin"), MB_YESNO | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL, LANGIDFROMLCID(Langpack_GetDefaultLocale()))) return 1; + return 0; + } if (InstallDialogBoxHook()) return 1; @@ -122,7 +127,9 @@ extern "C" __declspec(dllexport) int Unload(void) if (hwndHelpDlg != NULL) DestroyWindow(hwndHelpDlg); + FreeDialogCache(); + FreeLibrary(hMsftEdit); return 0; } -- cgit v1.2.3