summaryrefslogtreecommitdiff
path: root/plugins/ContextHelp
diff options
context:
space:
mode:
authorGoraf <goraf@miranda-ng.org>2016-02-06 18:40:38 +0000
committerGoraf <goraf@miranda-ng.org>2016-02-06 18:40:38 +0000
commit66fa09f8dc58870f6fe52e65f524381c7a782fbc (patch)
tree57975032c0d12efddf2f7fd3b74977fc5381ff29 /plugins/ContextHelp
parentedf2ac2358c5551f17bfe9e7a58c2ae23b0a1a3f (diff)
ContextHelp: fix handle leak
git-svn-id: http://svn.miranda-ng.org/main/trunk@16229 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ContextHelp')
-rw-r--r--plugins/ContextHelp/src/main.cpp9
1 files changed, 8 insertions, 1 deletions
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;
}