fix: add null-checks for MIDI ports and use atomic access for channel active flag
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
@@ -23,7 +23,7 @@ void channel_add(jack_client_t *client, int idx)
|
||||
return;
|
||||
}
|
||||
|
||||
channels[idx].active = 1;
|
||||
atomic_store(&channels[idx].active, 1);
|
||||
atomic_store(&channels[idx].state, STATE_IDLE);
|
||||
channels[idx].prev_state = -1;
|
||||
channels[idx].loop_count = 0;
|
||||
@@ -38,6 +38,6 @@ void channel_remove(jack_client_t *client, int idx)
|
||||
{
|
||||
jack_port_unregister(client, channels[idx].audio_in);
|
||||
jack_port_unregister(client, channels[idx].audio_out);
|
||||
channels[idx].active = 0;
|
||||
atomic_store(&channels[idx].active, 0);
|
||||
channel_count--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user