Loading libs/fakeservicemanager/FakeServiceManager.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -122,10 +122,20 @@ std::vector<IServiceManager::ServiceDebugInfo> FakeServiceManager::getServiceDeb } void FakeServiceManager::clear() { std::lock_guard<std::mutex> l(mMutex); std::map<String16, sp<IBinder>> backup; { std::lock_guard<std::mutex> l(mMutex); backup = mNameToService; mNameToService.clear(); } // destructors may access FSM, so avoid recursive lock backup.clear(); // explicit // TODO: destructors may have added more services here - may want // to check this or abort } } // namespace android [[clang::no_destroy]] static sp<FakeServiceManager> gFakeServiceManager; Loading Loading
libs/fakeservicemanager/FakeServiceManager.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -122,10 +122,20 @@ std::vector<IServiceManager::ServiceDebugInfo> FakeServiceManager::getServiceDeb } void FakeServiceManager::clear() { std::lock_guard<std::mutex> l(mMutex); std::map<String16, sp<IBinder>> backup; { std::lock_guard<std::mutex> l(mMutex); backup = mNameToService; mNameToService.clear(); } // destructors may access FSM, so avoid recursive lock backup.clear(); // explicit // TODO: destructors may have added more services here - may want // to check this or abort } } // namespace android [[clang::no_destroy]] static sp<FakeServiceManager> gFakeServiceManager; Loading