init: Do not invoke the ServiceList destructor when exiting

From the Google C++ style guide: "Objects with static storage duration
are forbidden unless they are trivially destructible." Hence this CL.

Bug: 213617178
Change-Id: I4c9a51618ee1eb14ed439295a5fc0101b940a63d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche 2022-12-02 19:00:37 -08:00
parent 633b9ba26b
commit c41a4826d1

View file

@ -24,8 +24,8 @@ namespace init {
ServiceList::ServiceList() {}
ServiceList& ServiceList::GetInstance() {
static ServiceList instance;
return instance;
static ServiceList* instance = new ServiceList;
return *instance;
}
size_t ServiceList::CheckAllCommands() {