Get rid of two runtime static destructors
Bug: 153704006
Test: compiles
Change-Id: Icb44c2d2c1e26b13a4d03a4996bffe016a141286
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 92366e5..4f64cad 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -20,6 +20,7 @@
#include <android-base/file.h>
#include <android-base/logging.h>
+#include <android-base/no_destructor.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
@@ -701,8 +702,8 @@
const IncrementalService::IfsMountPtr& IncrementalService::getIfsLocked(StorageId storage) const {
auto it = mMounts.find(storage);
if (it == mMounts.end()) {
- static const IfsMountPtr kEmpty = {};
- return kEmpty;
+ static const android::base::NoDestructor<IfsMountPtr> kEmpty{};
+ return *kEmpty;
}
return it->second;
}