diff options
author | nyamatongwe <devnull@localhost> | 2002-02-12 10:33:20 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2002-02-12 10:33:20 +0000 |
commit | fd6a4772446bae01aaaf5a9cb896bf4580c3c433 (patch) | |
tree | 8455e42c856dae4a5f0e25da08235c2738e92144 /win32/ScintillaWin.cxx | |
parent | b69cc17d081f60e53b1f09d9ba012e8233afe0de (diff) | |
download | scintilla-mirror-fd6a4772446bae01aaaf5a9cb896bf4580c3c433.tar.gz |
Made font cache thread safe by using a critical section.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c65600ab4..ddcab290b 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1916,12 +1916,19 @@ sptr_t PASCAL ScintillaWin::SWndProc( } } -extern HINSTANCE hinstPlatformRes; +extern void Platform_Initialise(void *hInstance); +extern void Platform_Finalise(); -// This function is externally visible so it can be called from container when building statically +// This function is externally visible so it can be called from container when building statically. +// Must be called once only. void Scintilla_RegisterClasses(void *hInstance) { - hinstPlatformRes = reinterpret_cast<HINSTANCE>(hInstance); - ScintillaWin::Register(hinstPlatformRes); + Platform_Initialise(hInstance); + ScintillaWin::Register(reinterpret_cast<HINSTANCE>(hInstance)); +} + +// This function is externally visible so it can be called from container when building statically. +void Scintilla_ReleaseResources() { + Platform_Finalise(); } #ifndef STATIC_BUILD @@ -1929,6 +1936,8 @@ extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) { //Platform::DebugPrintf("Scintilla::DllMain %d %d\n", hInstance, dwReason); if (dwReason == DLL_PROCESS_ATTACH) { Scintilla_RegisterClasses(hInstance); + } else if (dwReason == DLL_PROCESS_DETACH) { + Scintilla_ReleaseResources(); } return TRUE; } |