-- cgit v1.2.3 From 13ca9b24585d296a5db435621c919e096c9b03e4 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 26 May 2014 11:33:26 +1000 Subject: Bug [#1602]. Bug [#1603]. Fix hangs and crashes at shutdown. --- win32/PlatWin.cxx | 50 ++++++++++++++++++++++++++------------------------ win32/PlatWin.h | 2 +- win32/ScintillaWin.cxx | 16 +++++++++++----- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 082a177e6..507075a77 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -3280,31 +3280,33 @@ void Platform_Initialise(void *hInstance) { #pragma warning(default: 4996) #endif -void Platform_Finalise() { +void Platform_Finalise(bool fromDllMain) { #if defined(USE_D2D) - if (defaultRenderingParams) { - defaultRenderingParams->Release(); - defaultRenderingParams = 0; - } - if (customClearTypeRenderingParams) { - customClearTypeRenderingParams->Release(); - customClearTypeRenderingParams = 0; - } - if (pIDWriteFactory) { - pIDWriteFactory->Release(); - pIDWriteFactory = 0; - } - if (pD2DFactory) { - pD2DFactory->Release(); - pD2DFactory = 0; - } - if (hDLLDWrite) { - FreeLibrary(hDLLDWrite); - hDLLDWrite = NULL; - } - if (hDLLD2D) { - FreeLibrary(hDLLD2D); - hDLLD2D = NULL; + if (!fromDllMain) { + if (defaultRenderingParams) { + defaultRenderingParams->Release(); + defaultRenderingParams = 0; + } + if (customClearTypeRenderingParams) { + customClearTypeRenderingParams->Release(); + customClearTypeRenderingParams = 0; + } + if (pIDWriteFactory) { + pIDWriteFactory->Release(); + pIDWriteFactory = 0; + } + if (pD2DFactory) { + pD2DFactory->Release(); + pD2DFactory = 0; + } + if (hDLLDWrite) { + FreeLibrary(hDLLDWrite); + hDLLDWrite = NULL; + } + if (hDLLD2D) { + FreeLibrary(hDLLD2D); + hDLLD2D = NULL; + } } #endif if (reverseArrowCursor != NULL) diff --git a/win32/PlatWin.h b/win32/PlatWin.h index 93e1d7253..c284d42d3 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -14,7 +14,7 @@ namespace Scintilla { extern bool IsNT(); extern void Platform_Initialise(void *hInstance); -extern void Platform_Finalise(); +extern void Platform_Finalise(bool fromDllMain); #if defined(USE_D2D) extern bool LoadD2D(); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 762960685..d4f0415e8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2907,25 +2907,31 @@ int Scintilla_RegisterClasses(void *hInstance) { return result; } -// This function is externally visible so it can be called from container when building statically. -int Scintilla_ReleaseResources() { +static int ResourcesRelease(bool fromDllMain) { bool result = ScintillaWin::Unregister(); if (commctrl32) { FreeLibrary(commctrl32); commctrl32 = NULL; } - Platform_Finalise(); + Platform_Finalise(fromDllMain); return result; } +// This function is externally visible so it can be called from container when building statically. +int Scintilla_ReleaseResources() { + return ResourcesRelease(false); +} + #ifndef STATIC_BUILD -extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) { +extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) { //Platform::DebugPrintf("Scintilla::DllMain %d %d\n", hInstance, dwReason); if (dwReason == DLL_PROCESS_ATTACH) { if (!Scintilla_RegisterClasses(hInstance)) return FALSE; } else if (dwReason == DLL_PROCESS_DETACH) { - Scintilla_ReleaseResources(); + if (lpvReserved == NULL) { + ResourcesRelease(true); + } } return TRUE; } -- cgit v1.2.3 From ac4bb5e44a303b3ca95dc5773124ecef21a6a9ff Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 26 May 2014 11:36:09 +1000 Subject: Updates for 3.4.3 release. --- doc/ScintillaDownload.html | 10 +++++----- doc/ScintillaHistory.html | 11 +++++++++++ doc/index.html | 7 ++++--- qt/ScintillaEdit/ScintillaEdit.pro | 2 +- qt/ScintillaEditBase/ScintillaEditBase.pro | 2 +- version.txt | 2 +- win32/ScintRes.rc | 4 ++-- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/doc/ScintillaDownload.html b/doc/ScintillaDownload.html index 9e8dc3832..9ed55c609 100644 --- a/doc/ScintillaDownload.html +++ b/doc/ScintillaDownload.html @@ -25,9 +25,9 @@ @@ -41,7 +41,7 @@ containing very few restrictions.

- Release 3.4.2 + Release 3.4.3

Source Code @@ -49,8 +49,8 @@ The source code package contains all of the source code for Scintilla but no binary executable code and is available in
    -
  • zip format (1450K) commonly used on Windows
  • -
  • tgz format (1300K) commonly used on Linux and compatible operating systems
  • +
  • zip format (1450K) commonly used on Windows
  • +
  • tgz format (1300K) commonly used on Linux and compatible operating systems
Instructions for building on both Windows and Linux are included in the readme file.

diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 852503b86..99eb8a7be 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -459,6 +459,17 @@ Icons Copyright(C) 1998 by Dean S. Jones
+

+ Release 3.4.3 +

+

Release 3.4.2

diff --git a/doc/index.html b/doc/index.html index 5c230fb36..48e71b5d6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -9,7 +9,7 @@ - +
- + Windows   - + GTK+/Linux