diff options
| author | 2016-07-14 01:50:52 +0000 | |
|---|---|---|
| committer | 2016-07-14 01:50:52 +0000 | |
| commit | ce9cf64eb34242bd26bf4877d25c2058cbb52302 (patch) | |
| tree | ada671fc42c534ed1535e62012fd49a975c65276 | |
| parent | a7ebd4f4bb1bacc0f31228e03b631ca6f879891c (diff) | |
| parent | f8e99e72e7ceb1311e4c4bea55b1a8ff78d3aebe (diff) | |
Merge \"Don\'t hold on to AssetManager instances\" into nyc-dev
am: f8e99e72e7
Change-Id: I71b7499c6399ecbf1d8e8d93bf410aabbb2a1044
| -rw-r--r-- | core/java/android/content/res/TypedArray.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java index 92134ee01de8..1e44a5ccafc9 100644 --- a/core/java/android/content/res/TypedArray.java +++ b/core/java/android/content/res/TypedArray.java @@ -49,6 +49,10 @@ public class TypedArray { attrs.mLength = len; attrs.mRecycled = false; + // Reset the assets, which may have changed due to configuration changes + // or further resource loading. + attrs.mAssets = res.getAssets(); + final int fullLen = len * AssetManager.STYLE_NUM_ENTRIES; if (attrs.mData.length >= fullLen) { return attrs; @@ -66,7 +70,7 @@ public class TypedArray { private final Resources mResources; private final DisplayMetrics mMetrics; - private final AssetManager mAssets; + private AssetManager mAssets; private boolean mRecycled; @@ -1086,6 +1090,7 @@ public class TypedArray { // These may have been set by the client. mXml = null; mTheme = null; + mAssets = null; mResources.mTypedArrayPool.release(this); } |