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

Commit e8d39b9d authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am acdae5d7: Merge "Move stale handler cleanup to constructor" into lmp-dev

* commit 'acdae5d7':
  Move stale handler cleanup to constructor
parents ba19ee84 acdae5d7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -68,14 +68,14 @@ int64_t ALooper::GetNowUs() {

ALooper::ALooper()
    : mRunningLocally(false) {
    // clean up stale AHandlers. Doing it here instead of in the destructor avoids
    // the side effect of objects being deleted from the unregister function recursively.
    gLooperRoster.unregisterStaleHandlers();
}

ALooper::~ALooper() {
    stop();

    // Since this looper is "dead" (or as good as dead by now),
    // have ALooperRoster unregister any handlers still registered for it.
    gLooperRoster.unregisterStaleHandlers();
    // stale AHandlers are now cleaned up in the constructor of the next ALooper to come along
}

void ALooper::setName(const char *name) {