Remove null entries from constant state cache

We insert null entries on cache miss, which can cause NPE on prune, but
we ought to remove these entries during prune.

BUG: 18842826
Change-Id: I9c0bca04f34575d1403de943abd8d12b18c9c032
This commit is contained in:
Alan Viverette
2015-01-05 11:09:29 -08:00
parent 74f89e78b0
commit d6ebb3a75e

View File

@@ -2463,7 +2463,7 @@ public class Resources {
final int N = cache.size();
for (int i = N - 1; i >= 0; i--) {
final WeakReference entry = cache.valueAt(i);
if (entry.get() == null) {
if (entry == null || entry.get() == null) {
cache.removeAt(i);
}
}