diff options
author | Neil <nyamatongwe@gmail.com> | 2014-04-25 10:23:16 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-04-25 10:23:16 +1000 |
commit | 6bf6dc4af23d63b608560e09cb5b382e496e1a19 (patch) | |
tree | 2c0fea55d7177ace20d9b6f4a88060be62f4e507 /win32/ScintillaWin.cxx | |
parent | c4188fc16fdae8a79794f97001ffa09e387104a5 (diff) | |
download | scintilla-mirror-6bf6dc4af23d63b608560e09cb5b382e496e1a19.tar.gz |
Free system libraries at finalization.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 0e2308c70..a0372f574 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -125,6 +125,8 @@ class ScintillaWin; // Forward declaration for COM interface subobjects typedef void VFunction(void); +static HMODULE commctrl32 = 0; + /** */ class FormatEnumerator { @@ -383,7 +385,8 @@ void ScintillaWin::Initialise() { TrackMouseEventFn = (TrackMouseEventSig)::GetProcAddress(user32, "TrackMouseEvent"); if (TrackMouseEventFn == NULL) { // Windows 95 has an emulation in comctl32.dll:_TrackMouseEvent - HMODULE commctrl32 = ::LoadLibrary(TEXT("comctl32.dll")); + if (!commctrl32) + commctrl32 = ::LoadLibrary(TEXT("comctl32.dll")); if (commctrl32 != NULL) { TrackMouseEventFn = (TrackMouseEventSig) ::GetProcAddress(commctrl32, "_TrackMouseEvent"); @@ -2872,6 +2875,10 @@ int Scintilla_RegisterClasses(void *hInstance) { // This function is externally visible so it can be called from container when building statically. int Scintilla_ReleaseResources() { bool result = ScintillaWin::Unregister(); + if (commctrl32) { + FreeLibrary(commctrl32); + commctrl32 = NULL; + } Platform_Finalise(); return result; } |