Fix crash on close, do not setup worker threads
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
ff5f9f6285
commit
86fbd84cf6
3 changed files with 29 additions and 4 deletions
|
@ -108,5 +108,16 @@ int main()
|
||||||
i+1, q->name.c_str(), q->getDescription().c_str(), q->unit.c_str(),
|
i+1, q->name.c_str(), q->getDescription().c_str(), q->unit.c_str(),
|
||||||
q->minValue, q->maxValue, q->defaultValue);
|
q->minValue, q->maxValue, q->defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Module::ProcessArgs args = {
|
||||||
|
48000.0f,
|
||||||
|
1.0f / 48000.0f,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
for (int i=0; i<96000; ++i)
|
||||||
|
{
|
||||||
|
module->process(args);
|
||||||
|
++args.frame;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct Initializer
|
||||||
#ifdef __MOD_DEVICES__
|
#ifdef __MOD_DEVICES__
|
||||||
settings::threadCount = 3;
|
settings::threadCount = 3;
|
||||||
#else
|
#else
|
||||||
settings::threadCount = 1;
|
settings::threadCount = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
system::init();
|
system::init();
|
||||||
|
@ -768,7 +768,10 @@ protected:
|
||||||
const MutexLocker cml(fDeviceMutex);
|
const MutexLocker cml(fDeviceMutex);
|
||||||
|
|
||||||
if (fCurrentAudioDevice != nullptr)
|
if (fCurrentAudioDevice != nullptr)
|
||||||
|
{
|
||||||
|
rack::contextSet(context);
|
||||||
fCurrentAudioDevice->onStartStream();
|
fCurrentAudioDevice->onStartStream();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,7 +781,10 @@ protected:
|
||||||
const MutexLocker cml(fDeviceMutex);
|
const MutexLocker cml(fDeviceMutex);
|
||||||
|
|
||||||
if (fCurrentAudioDevice != nullptr)
|
if (fCurrentAudioDevice != nullptr)
|
||||||
|
{
|
||||||
|
rack::contextSet(context);
|
||||||
fCurrentAudioDevice->onStopStream();
|
fCurrentAudioDevice->onStopStream();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] fAudioBufferOut;
|
delete[] fAudioBufferOut;
|
||||||
|
@ -866,6 +872,13 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sampleRateChanged(const double newSampleRate) override
|
||||||
|
{
|
||||||
|
rack::contextSet(context);
|
||||||
|
rack::settings::sampleRate = newSampleRate;
|
||||||
|
context->engine->setSampleRate(newSampleRate);
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -129,10 +129,12 @@ public:
|
||||||
|
|
||||||
~CardinalUI() override
|
~CardinalUI() override
|
||||||
{
|
{
|
||||||
const ScopedContext sc(this);
|
rack::contextSet(fContext);
|
||||||
|
|
||||||
delete fContext->window;
|
delete fContext->window;
|
||||||
fContext->window = nullptr;
|
fContext->window = nullptr;
|
||||||
|
|
||||||
|
rack::contextSet(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onNanoDisplay() override
|
void onNanoDisplay() override
|
||||||
|
@ -513,9 +515,8 @@ protected:
|
||||||
if (filename == nullptr)
|
if (filename == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// we cannot lock here
|
|
||||||
// const ScopedContext sc(this);
|
|
||||||
rack::contextSet(fContext);
|
rack::contextSet(fContext);
|
||||||
|
WindowParametersRestore(fContext->window);
|
||||||
fContext->patch->loadAction(filename);
|
fContext->patch->loadAction(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue