Merge "Recycle TypedArrays in Fade and TransitionInflater"

This commit is contained in:
Yuichi Araki
2017-02-28 02:41:34 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 0 deletions

View File

@@ -103,6 +103,7 @@ public class Fade extends Visibility {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Fade);
int fadingMode = a.getInt(R.styleable.Fade_fadingMode, getMode());
setMode(fadingMode);
a.recycle();
}
@Override

View File

@@ -276,9 +276,11 @@ public class TransitionInflater {
transition.addTarget(clazz);
}
} catch (ClassNotFoundException e) {
a.recycle();
throw new RuntimeException("Could not create " + className, e);
}
}
a.recycle();
} else {
throw new RuntimeException("Unknown scene name: " + parser.getName());
}