From 9929c3fac1e2024f410e0bd4d85e2e732f95bd78 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 7 Oct 2018 23:32:31 -0400 Subject: [PATCH] use unique lock for replacing extensions and fix extensions with _ in them --- GUI/extensions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GUI/extensions.cpp b/GUI/extensions.cpp index 54b5e95..4fb6b64 100644 --- a/GUI/extensions.cpp +++ b/GUI/extensions.cpp @@ -18,9 +18,10 @@ std::map LoadExtensions() int extensionNumber = file.split("_")[0].toInt(); newExtensions[extensionNumber] = (ExtensionFunction)GetProcAddress(GetModuleHandleW(file.toStdWString().c_str()), "OnNewSentence"); file.chop(sizeof("dll")); - extensionNames[extensionNumber] = file.split("_")[1]; + file.remove(0, file.indexOf("_") + 1); + extensionNames[extensionNumber] = file; } - std::shared_lock extenLock(extenMutex); + std::unique_lock extenLock(extenMutex); extensions = newExtensions; return extensionNames; }