Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0afa5afb authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix crash in audiosystem_tests" am: cada19c0

parents 50b583ba cada19c0
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -49,12 +49,18 @@ class AudioSystemTest : public ::testing::Test {
    void TearDown() override {
        if (mPlayback) {
            mPlayback->stop();
            mPlayback->getAudioTrackHandle()->removeAudioDeviceCallback(mCbPlayback);
            if (auto handle = mPlayback->getAudioTrackHandle(); handle) {
                handle->removeAudioDeviceCallback(mCbPlayback);
            }
            mCbPlayback.clear();
            mPlayback.clear();
        }
        if (mCapture) {
            mCapture->stop();
            mCapture->getAudioRecordHandle()->removeAudioDeviceCallback(mCbRecord);
            if (auto handle = mCapture->getAudioRecordHandle(); handle) {
                handle->removeAudioDeviceCallback(mCbRecord);
            }
            mCbRecord.clear();
            mCapture.clear();
        }
    }