Merge "Resources: fix race with creating theme" into oc-dev

This commit is contained in:
Adam Lesinski
2017-05-23 23:14:11 +00:00
committed by Android (Google) Code Review

View File

@@ -1760,7 +1760,9 @@ public class Resources {
public final Theme newTheme() {
Theme theme = new Theme();
theme.setImpl(mResourcesImpl.newThemeImpl());
mThemeRefs.add(new WeakReference<>(theme));
synchronized (mThemeRefs) {
mThemeRefs.add(new WeakReference<>(theme));
}
return theme;
}