mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 01:14:12 +08:00
use unique lock for replacing extensions and fix extensions with _ in them
This commit is contained in:
parent
a21ee5bba4
commit
9929c3fac1
@ -18,9 +18,10 @@ std::map<int, QString> LoadExtensions()
|
|||||||
int extensionNumber = file.split("_")[0].toInt();
|
int extensionNumber = file.split("_")[0].toInt();
|
||||||
newExtensions[extensionNumber] = (ExtensionFunction)GetProcAddress(GetModuleHandleW(file.toStdWString().c_str()), "OnNewSentence");
|
newExtensions[extensionNumber] = (ExtensionFunction)GetProcAddress(GetModuleHandleW(file.toStdWString().c_str()), "OnNewSentence");
|
||||||
file.chop(sizeof("dll"));
|
file.chop(sizeof("dll"));
|
||||||
extensionNames[extensionNumber] = file.split("_")[1];
|
file.remove(0, file.indexOf("_") + 1);
|
||||||
|
extensionNames[extensionNumber] = file;
|
||||||
}
|
}
|
||||||
std::shared_lock<std::shared_mutex> extenLock(extenMutex);
|
std::unique_lock<std::shared_mutex> extenLock(extenMutex);
|
||||||
extensions = newExtensions;
|
extensions = newExtensions;
|
||||||
return extensionNames;
|
return extensionNames;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user