Skip to content
Snippets Groups Projects
Unverified Commit 301d9af8 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

audio: protect recorder_->stop() from null pointer exception

Change-Id: Ibb7ed1c76dafc7368655b0751f94a4b0df6a531d
parent 69ffe0b2
No related branches found
No related tags found
No related merge requests found
...@@ -397,8 +397,10 @@ OpenSLLayer::stopAudioCapture() ...@@ -397,8 +397,10 @@ OpenSLLayer::stopAudioCapture()
{ {
std::lock_guard<std::mutex> lck(recMtx); std::lock_guard<std::mutex> lck(recMtx);
recorder_->stop(); if (recorder_) {
recorder_.reset(); recorder_->stop();
recorder_.reset();
}
} }
if (recThread.joinable()) { if (recThread.joinable()) {
recCv.notify_all(); recCv.notify_all();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment