From b5b2247de50e20e7db3c64e786aab788d9f49148 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 6 Jun 2020 10:09:29 +1000 Subject: Defer most initialisation until Scintilla window is created. Previously, more initialisation was performed inside DllMain but some actions such as loading libraries are unsafe inside DllMain. Avoid listbox UnregisterClass if no attempt to register which will occur if no Scintilla windows were created. std::call_once is used to ensure initialisation is performed at most once. --- win32/PlatWin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'win32/PlatWin.h') diff --git a/win32/PlatWin.h b/win32/PlatWin.h index d88ee6324..58ba5e78f 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -14,7 +14,8 @@ namespace Scintilla { #define USER_DEFAULT_SCREEN_DPI 96 #endif -extern void Platform_Initialise(void *hInstance); +extern void Platform_Initialise(void *hInstance) noexcept; + extern void Platform_Finalise(bool fromDllMain); constexpr RECT RectFromPRectangle(PRectangle prc) noexcept { -- cgit v1.2.3