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

Commit 6844c157 authored by Sergey Ten's avatar Sergey Ten Committed by Josh Guilfoyle
Browse files

Fix a potential crash in AssetManager during cleanup.

CR: Josh Guilfoyle
parent 4615c834
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3951,15 +3951,16 @@ void ResTable::removeAssetsByCookie(const String8 &packageName, void* cookie)
            if (id != 0 && id < 256) {
                mPackageMap[id] = 0;
            }
            pg->packages.removeAt(index);
            delete pkg;
            if (pkgCount == 1) {
                LOGV("Delete Package Group %d id=%d packageCount=%d name=%s\n",
                      (int)pgIndex, pg->id, (int)pg->packages.size(),
                      String8(pg->name).string());
                mPackageGroups.removeAt(pgIndex);
            }
                delete pg;
            } else {
                pg->packages.removeAt(index);
                delete pkg;
            }
            return;
        }
    }