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

Commit 224ffd3c authored by Adam Lesinski's avatar Adam Lesinski Committed by android-build-merger
Browse files

Merge "[AssetManager]:Fix thread race caused double free issue." am: 126e0220 am: f48d0b8f

am: 73b91c63

Change-Id: I27f5cc6106f0a8f0a58721e1e8ed836144347b6a
parents b2361007 73b91c63
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1893,6 +1893,7 @@ ZipFileRO* AssetManager::SharedZip::getZip()

Asset* AssetManager::SharedZip::getResourceTableAsset()
{
    AutoMutex _l(gLock);
    ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset);
    return mResourceTableAsset;
}
@@ -1902,10 +1903,10 @@ Asset* AssetManager::SharedZip::setResourceTableAsset(Asset* asset)
    {
        AutoMutex _l(gLock);
        if (mResourceTableAsset == NULL) {
            mResourceTableAsset = asset;
            // This is not thread safe the first time it is called, so
            // do it here with the global lock held.
            asset->getBuffer(true);
            mResourceTableAsset = asset;
            return asset;
        }
    }