From b42895345a12d3742cf7469eee4c0c67ef67bfa3 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Fri, 2 Aug 2019 21:13:36 +0300 Subject: [PATCH] Log a debug message when unloading a dynamic library fails on MSW Logging (even non-debug logging) in similar situation already happens on *nix. Closes https://github.com/wxWidgets/wxWidgets/pull/1545 --- src/msw/dlmsw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/dlmsw.cpp b/src/msw/dlmsw.cpp index 849eb691e7..d664c6ae4b 100644 --- a/src/msw/dlmsw.cpp +++ b/src/msw/dlmsw.cpp @@ -166,7 +166,10 @@ wxDynamicLibrary::RawLoad(const wxString& libname, int flags) /* static */ void wxDynamicLibrary::Unload(wxDllType handle) { - ::FreeLibrary(handle); + if ( !::FreeLibrary(handle) ) + { + wxLogLastError(wxT("FreeLibrary")); + } } /* static */