* commit 'df52471c994f2374ae87ce52dbad61b43e7285e8': Fix leak in TransitionInflater
This commit is contained in:
@@ -1255,7 +1255,8 @@ public abstract class Transition implements Cloneable {
|
||||
Animator anim = runningAnimators.keyAt(i);
|
||||
if (anim != null) {
|
||||
AnimationInfo oldInfo = runningAnimators.get(anim);
|
||||
if (oldInfo != null) {
|
||||
if (oldInfo != null && oldInfo.view != null &&
|
||||
oldInfo.view.getContext() == sceneRoot.getContext()) {
|
||||
boolean cancel = false;
|
||||
TransitionValues oldValues = oldInfo.values;
|
||||
View oldView = oldInfo.view;
|
||||
|
||||
@@ -20,9 +20,7 @@ import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.SparseArray;
|
||||
import android.util.Xml;
|
||||
import android.view.InflateException;
|
||||
import android.view.ViewGroup;
|
||||
@@ -43,15 +41,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class TransitionInflater {
|
||||
|
||||
// We only need one inflater for any given context. Also, this allows us to associate
|
||||
// ids with unique instances per-Context, used to avoid re-inflating
|
||||
// already-inflated resources into new/different instances
|
||||
private static final ArrayMap<Context, TransitionInflater> sInflaterMap =
|
||||
new ArrayMap<Context, TransitionInflater>();
|
||||
|
||||
private Context mContext;
|
||||
// TODO: do we need id maps for transitions and transitionMgrs as well?
|
||||
SparseArray<Scene> mScenes = new SparseArray<Scene>();
|
||||
|
||||
private TransitionInflater(Context context) {
|
||||
mContext = context;
|
||||
@@ -61,13 +51,7 @@ public class TransitionInflater {
|
||||
* Obtains the TransitionInflater from the given context.
|
||||
*/
|
||||
public static TransitionInflater from(Context context) {
|
||||
TransitionInflater inflater = sInflaterMap.get(context);
|
||||
if (inflater != null) {
|
||||
return inflater;
|
||||
}
|
||||
inflater = new TransitionInflater(context);
|
||||
sInflaterMap.put(context, inflater);
|
||||
return inflater;
|
||||
return new TransitionInflater(context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user