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

Commit 815494c7 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by android-build-merger
Browse files

Merge "libprocessgroup: Deliberately leak TaskProfiles and CgroupMap instances." am: b552c4ad

am: a7da5b4a

Change-Id: I49fe37e8c99e31f3bc5d1cd687fcdd17a1eeafc7
parents 549346f9 a7da5b4a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -336,8 +336,10 @@ CgroupMap::~CgroupMap() {
}

CgroupMap& CgroupMap::GetInstance() {
    static CgroupMap instance;
    return instance;
    // Deliberately leak this object to avoid a race between destruction on
    // process exit and concurrent access from another thread.
    static auto* instance = new CgroupMap;
    return *instance;
}

bool CgroupMap::LoadRcFile() {
+4 −2
Original line number Diff line number Diff line
@@ -284,8 +284,10 @@ bool TaskProfile::ExecuteForTask(int tid) const {
}

TaskProfiles& TaskProfiles::GetInstance() {
    static TaskProfiles instance;
    return instance;
    // Deliberately leak this object to avoid a race between destruction on
    // process exit and concurrent access from another thread.
    static auto* instance = new TaskProfiles;
    return *instance;
}

TaskProfiles::TaskProfiles() {