diff options
author | Riddle Hsu <riddlehsu@google.com> | 2019-07-04 16:10:08 +0800 |
---|---|---|
committer | Riddle Hsu <riddlehsu@google.com> | 2019-07-04 16:10:08 +0800 |
commit | cfa2284cd851ca24abb4bfc5808acdef77f6d520 (patch) | |
tree | 7ac2e04497923bc0445a949897cb34dc9dde5656 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | 4b235cb04acd078c04a1aeb7ac68490087739841 (diff) |
Fix potential double destroy of AssetManager
Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.
By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.
Bug: 136721562
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
adb shell am instrument -w -r --no-hidden-api-checks -e class \
android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner
Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions