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

Commit edfd5ce1 authored by Brian Duddie's avatar Brian Duddie Committed by android-build-merger
Browse files

Fix null deref in sensors 2.0 VTS teardown am: b6b28e58

am: 6e4370b5

Change-Id: Ia83ca44811b5cda68152cee2c989a533e3e43e75
parents 99491c82 6e4370b5
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -109,12 +109,16 @@ bool SensorsHidlEnvironmentV2_0::resetHal() {
void SensorsHidlEnvironmentV2_0::HidlTearDown() {
    mStopThread = true;

    if (mEventQueueFlag != nullptr) {
        // Wake up the event queue so the poll thread can exit
        mEventQueueFlag->wake(asBaseType(EventQueueFlagBits::READ_AND_PROCESS));
        if (mPollThread.joinable()) {
            mPollThread.join();
        }

        EventFlag::deleteEventFlag(&mEventQueueFlag);
    }
}

void SensorsHidlEnvironmentV2_0::startPollingThread() {
    mStopThread = false;