mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-21 03:52:07 -05:00
Fix crash when importing macros is slow
Probably not a real issue. Noticed during debug of another problem.
This commit is contained in:
parent
f9f26ad50b
commit
ea2d1e7e9d
|
|
@ -395,7 +395,7 @@ void AdvSceneSwitcher::ImportMacros()
|
|||
std::vector<std::shared_ptr<Macro>> importedMacros;
|
||||
auto &tempMacros = GetTemporaryMacros();
|
||||
|
||||
auto lock = LockContext();
|
||||
std::unique_lock<std::mutex> lock(*GetMutex());
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
tempMacros.clear();
|
||||
|
||||
|
|
@ -405,10 +405,14 @@ void AdvSceneSwitcher::ImportMacros()
|
|||
macro->Load(array_obj);
|
||||
RunAndClearPostLoadSteps();
|
||||
|
||||
if (macroNameExists(macro->Name()) &&
|
||||
!ResolveMacroImportNameConflict(macro)) {
|
||||
groupSize--;
|
||||
continue;
|
||||
if (macroNameExists(macro->Name())) {
|
||||
lock.unlock();
|
||||
bool resolved = ResolveMacroImportNameConflict(macro);
|
||||
lock.lock();
|
||||
if (!resolved) {
|
||||
groupSize--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
importedMacros.emplace_back(macro);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user