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

Commit 9ff600f6 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Remove ApkAssets access in finalizer

ResourcesProvider#finalize called ApkAssets#close. ApkAssets#close is
called during ApkAssets#finalize. If a ResourcesProvider and its
corresponding ApkAssets are finalized concurrently, there may be a
chance that the ApkAsset could be finalized first and then
ResourcesProvider calls ApkAssets#close on the object that has already
been finalized.

This may not fix the bug, but there is no reason to close the ApkAsset
during finalization of the ResourcesProvider.

Bug: 159041693
Test: none
Change-Id: I317ca982df2e11a18ccd6c95c74565dbac417bd6
parent b50914c5
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -284,11 +284,6 @@ public class ResourcesProvider implements AutoCloseable, Closeable {
                Log.w(TAG, "ResourcesProvider " + this + " finalized with non-zero refs: "
                        + mOpenCount);
            }

            if (mOpen) {
                mOpen = false;
                mApkAssets.close();
            }
        }
    }
}