Closed philburk closed 6 years ago
The error callback launches a thread to restart the stream when disconnected.
It creates a thread and stores a pointer in streamRestartThread, which is never deleted. Also streamRestartThread is never initialized.
I am also concerned that there might be a race condition when the restartStream std::function object goes out of scope.
A better approach might be what we do in Oboe.
std::thread t(oboe_aaudio_error_thread_proc, oboeStream, stream, static_cast<Result>(error)); t.detach();
let me have a look at it.
The error callback launches a thread to restart the stream when disconnected.
It creates a thread and stores a pointer in streamRestartThread, which is never deleted. Also streamRestartThread is never initialized.
I am also concerned that there might be a race condition when the restartStream std::function object goes out of scope.
A better approach might be what we do in Oboe.