Fix resource leak caused by TypedArray type

Change-Id: If4a95fe7d3b7686c3189fae803c795bcf5accf24
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
Gao Honghua
2023-06-13 08:12:19 +08:00
committed by Jia Jia
parent caeb150e54
commit 6fc3edd3d0

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.