Loading libs/binder/BpBinder.cpp +19 −15 Original line number Diff line number Diff line Loading @@ -387,21 +387,6 @@ BpBinder::~BpBinder() } } mLock.lock(); Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if (ipc) ipc->clearDeathNotification(mHandle, this); mObituaries = nullptr; } mLock.unlock(); if (obits != nullptr) { // XXX Should we tell any remaining DeathRecipient // objects that the last strong ref has gone away, so they // are no longer linked? delete obits; } if (ipc) { ipc->expungeHandle(mHandle, this); ipc->decWeakHandle(mHandle); Loading @@ -423,6 +408,25 @@ void BpBinder::onLastStrongRef(const void* /*id*/) } IPCThreadState* ipc = IPCThreadState::self(); if (ipc) ipc->decStrongHandle(mHandle); mLock.lock(); Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if (!obits->isEmpty()) { ALOGI("onLastStrongRef automatically unlinking death recipients"); } if (ipc) ipc->clearDeathNotification(mHandle, this); mObituaries = nullptr; } mLock.unlock(); if (obits != nullptr) { // XXX Should we tell any remaining DeathRecipient // objects that the last strong ref has gone away, so they // are no longer linked? delete obits; } } bool BpBinder::onIncStrongAttempted(uint32_t /*flags*/, const void* /*id*/) Loading Loading
libs/binder/BpBinder.cpp +19 −15 Original line number Diff line number Diff line Loading @@ -387,21 +387,6 @@ BpBinder::~BpBinder() } } mLock.lock(); Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if (ipc) ipc->clearDeathNotification(mHandle, this); mObituaries = nullptr; } mLock.unlock(); if (obits != nullptr) { // XXX Should we tell any remaining DeathRecipient // objects that the last strong ref has gone away, so they // are no longer linked? delete obits; } if (ipc) { ipc->expungeHandle(mHandle, this); ipc->decWeakHandle(mHandle); Loading @@ -423,6 +408,25 @@ void BpBinder::onLastStrongRef(const void* /*id*/) } IPCThreadState* ipc = IPCThreadState::self(); if (ipc) ipc->decStrongHandle(mHandle); mLock.lock(); Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if (!obits->isEmpty()) { ALOGI("onLastStrongRef automatically unlinking death recipients"); } if (ipc) ipc->clearDeathNotification(mHandle, this); mObituaries = nullptr; } mLock.unlock(); if (obits != nullptr) { // XXX Should we tell any remaining DeathRecipient // objects that the last strong ref has gone away, so they // are no longer linked? delete obits; } } bool BpBinder::onIncStrongAttempted(uint32_t /*flags*/, const void* /*id*/) Loading