Fix memory leak on wifi

Google: 3425623
Change-Id: I5cd3c427280ebb2e8ed1b18d39d1b29c962b7658
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
Gao Honghua
2024-12-19 14:48:59 +08:00
committed by Joey
parent c51ca8b50f
commit b893ae175e

View File

@@ -262,7 +262,13 @@ public class WifiEntryPreference extends RestrictedPreference implements
// 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;
}
}
/**