Recycle TypedArrays in Fade and TransitionInflater

Test: Builds
Change-Id: I91e214eafc87850dca6986af2054e5edca46e724
This commit is contained in:
Yuichi Araki
2017-02-09 18:47:18 +09:00
parent 081a9a7593
commit fb6ed353a6
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());
}