Cleanup related fixes

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-06-27 17:32:10 +01:00
parent 10330964ea
commit 3046133883
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
5 changed files with 111 additions and 3 deletions

View file

@ -79,6 +79,7 @@ struct Engine::Internal {
int64_t blockFrame = 0;
double blockTime = 0.0;
int blockFrames = 0;
bool aboutToClose = false;
#ifndef HEADLESS
// Meter
@ -776,6 +777,8 @@ void Engine::prepareSaveModule(Module* module) {
void Engine::prepareSave() {
if (internal->aboutToClose)
return;
SharedLock<SharedMutex> lock(internal->mutex);
for (Module* module : internal->modules) {
Module::SaveEvent e;
@ -1175,5 +1178,10 @@ void Engine::startFallbackThread() {
}
void Engine_setAboutToClose(Engine* const engine) {
engine->internal->aboutToClose = true;
}
} // namespace engine
} // namespace rack