mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 14:33:01 +00:00
fix possible crash when changing colors
if chan osc threads >= 0
This commit is contained in:
parent
ca5cf58d00
commit
7fdc826f83
2 changed files with 16 additions and 8 deletions
|
@ -95,7 +95,11 @@ bool DivWorkThread::busy() {
|
|||
void DivWorkThread::finish() {
|
||||
lock.lock();
|
||||
terminate=true;
|
||||
notify.set_value();
|
||||
try {
|
||||
notify.set_value();
|
||||
} catch (std::future_error& e) {
|
||||
logE("future error! beware!");
|
||||
}
|
||||
lock.unlock();
|
||||
thread->join();
|
||||
}
|
||||
|
@ -196,9 +200,11 @@ DivWorkPool::DivWorkPool(unsigned int threads):
|
|||
|
||||
DivWorkPool::~DivWorkPool() {
|
||||
if (threaded) {
|
||||
for (unsigned int i=0; i<count; i++) {
|
||||
workThreads[i].finish();
|
||||
if (workThreads!=NULL) {
|
||||
for (unsigned int i=0; i<count; i++) {
|
||||
workThreads[i].finish();
|
||||
}
|
||||
delete[] workThreads;
|
||||
}
|
||||
delete[] workThreads;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5437,10 +5437,12 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
}
|
||||
}
|
||||
|
||||
// chan osc work pool
|
||||
if (chanOscWorkPool!=NULL) {
|
||||
delete chanOscWorkPool;
|
||||
chanOscWorkPool=NULL;
|
||||
if (updateFonts) {
|
||||
// chan osc work pool
|
||||
if (chanOscWorkPool!=NULL) {
|
||||
delete chanOscWorkPool;
|
||||
chanOscWorkPool=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<64; i++) {
|
||||
|
|
Loading…
Reference in a new issue