mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-10-30 19:57:52 +00:00
clang-format, and avoid another potential leak
This commit is contained in:
parent
f9750875e3
commit
21159dd83a
1 changed files with 8 additions and 3 deletions
|
@ -37,8 +37,12 @@ CubebInput::~CubebInput() {
|
|||
if (!impl->ctx)
|
||||
return;
|
||||
|
||||
if (impl->stream && cubeb_stream_stop(impl->stream) != CUBEB_OK) {
|
||||
LOG_ERROR(Audio, "Error stopping cubeb input stream.");
|
||||
if (impl->stream) {
|
||||
if (cubeb_stream_stop(impl->stream) != CUBEB_OK) {
|
||||
LOG_ERROR(Audio, "Error stopping cubeb input stream.");
|
||||
}
|
||||
|
||||
cubeb_stream_destroy(impl->stream);
|
||||
}
|
||||
|
||||
cubeb_destroy(impl->ctx);
|
||||
|
@ -103,7 +107,8 @@ void CubebInput::StartSampling(const Frontend::Mic::Parameters& params) {
|
|||
}
|
||||
|
||||
void CubebInput::StopSampling() {
|
||||
// TODO(xperia64): Destroy the stream for now to avoid a leak because StartSampling reinitializes the stream every time
|
||||
// TODO(xperia64): Destroy the stream for now to avoid a leak because StartSampling
|
||||
// reinitializes the stream every time
|
||||
if (impl->stream) {
|
||||
cubeb_stream_stop(impl->stream);
|
||||
cubeb_stream_destroy(impl->stream);
|
||||
|
|
Loading…
Reference in a new issue