From 26b41d025b55fc809fd28461968cf5e6779e29f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Ni=C3=9Fl?= Date: Thu, 18 Jan 2024 09:11:07 +1100 Subject: Use the multi-threaded option to Direct2D to avoid crashes when Scintilla instances created on different threads. --- win32/PlatWin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 91af4a683..57d26a36a 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -98,8 +98,8 @@ void LoadD2DOnce() noexcept { hDLLD2D = ::LoadLibraryEx(TEXT("D2D1.DLL"), 0, loadLibraryFlags); D2D1CFSig fnD2DCF = DLLFunction(hDLLD2D, "D2D1CreateFactory"); if (fnD2DCF) { - // A single threaded factory as Scintilla always draw on the GUI thread - fnD2DCF(D2D1_FACTORY_TYPE_SINGLE_THREADED, + // A multi threaded factory in case Scintilla is used with multiple GUI threads + fnD2DCF(D2D1_FACTORY_TYPE_MULTI_THREADED, __uuidof(ID2D1Factory), nullptr, reinterpret_cast(&pD2DFactory)); -- cgit v1.2.3