diff options
| author | 2016-07-14 01:40:34 +0000 | |
|---|---|---|
| committer | 2016-07-14 01:40:35 +0000 | |
| commit | f8e99e72e7ceb1311e4c4bea55b1a8ff78d3aebe (patch) | |
| tree | ead78e65b837ec737f53cb3b72c3c0efec9b1b37 | |
| parent | 9604b3803c9688cad8acab0699218f8a7921ec5c (diff) | |
| parent | e60064ab3c399fdd084de11dada73af48735d2fc (diff) | |
Merge "Don't hold on to AssetManager instances" into nyc-dev
| -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); } |