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

Commit 75b18738 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Perform cleanup operation on destroy()" into udc-dev

parents 3ef28b60 9f0f647f
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -55,14 +55,13 @@ SensorService::SensorEventConnection::SensorEventConnection(
SensorService::SensorEventConnection::~SensorEventConnection() {
    ALOGD_IF(DEBUG_CONNECTIONS, "~SensorEventConnection(%p)", this);
    destroy();
    mService->cleanupConnection(this);
    if (mEventCache != nullptr) {
    delete[] mEventCache;
}
}

void SensorService::SensorEventConnection::destroy() {
    mDestroyed = true;
    if (!mDestroyed.exchange(true)) {
      mService->cleanupConnection(this);
    }
}

void SensorService::SensorEventConnection::onFirstRef() {