Merge "Fix resource leak caused by TypedArray type"

This commit is contained in:
Treehugger Robot
2023-06-13 14:20:56 +00:00
committed by Gerrit Code Review

View File

@@ -87,7 +87,13 @@ public class AccessPointPreference extends Preference {
// Fallback for platforms that do not need friction icon resources.
frictionSld = null;
}
return frictionSld != null ? (StateListDrawable) frictionSld.getDrawable(0) : null;
if (frictionSld != null) {
StateListDrawable val = (StateListDrawable) frictionSld.getDrawable(0);
frictionSld.recycle();
return val;
} else {
return null;
}
}
// Used for fake pref.