summaryrefslogtreecommitdiffhomepage
path: root/windows/nsis-plugins/src/log/log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'windows/nsis-plugins/src/log/log.cpp')
-rw-r--r--windows/nsis-plugins/src/log/log.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/windows/nsis-plugins/src/log/log.cpp b/windows/nsis-plugins/src/log/log.cpp
index a491dc9b2d..6940240137 100644
--- a/windows/nsis-plugins/src/log/log.cpp
+++ b/windows/nsis-plugins/src/log/log.cpp
@@ -19,6 +19,8 @@ Logger *g_logger = nullptr;
namespace
{
+bool g_pinned = false;
+
std::wstring PopString()
{
//
@@ -45,6 +47,11 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase;
void PinDll()
{
+ if (g_pinned)
+ {
+ return;
+ }
+
//
// Apparently NSIS loads and unloads the plugin module for EVERY call it makes to the plugin.
// This makes it kind of difficult to maintain state.
@@ -68,6 +75,8 @@ void PinDll()
{
LoadLibraryW(self);
}
+
+ g_pinned = true;
}
std::vector<std::wstring> BlockToRows(const std::wstring &textBlock)