mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 13:48:02 +08:00
fix a colorstatelist's memleak
This commit is contained in:
parent
e1e4c520ee
commit
bd37128832
@ -109,9 +109,8 @@ void Drawable::setColorFilter(int color,PorterDuffMode mode) {
|
||||
}
|
||||
|
||||
void Drawable::setTint(int color) {
|
||||
ColorStateList*tint =ColorStateList::valueOf(color);
|
||||
setTintList(tint);
|
||||
delete tint;
|
||||
ColorStateList cls(color);
|
||||
setTintList(&cls);
|
||||
}
|
||||
|
||||
PorterDuffColorFilter *Drawable::updateTintFilter(PorterDuffColorFilter* tintFilter,const ColorStateList* tint,int tintMode) {
|
||||
|
@ -340,7 +340,8 @@ void GradientDrawable::setStroke(int width, const ColorStateList*colorStateList)
|
||||
}
|
||||
|
||||
void GradientDrawable::setStroke(int width,int color, float dashWidth, float dashGap) {
|
||||
mGradientState->setStroke(width, ColorStateList::valueOf(color), dashWidth, dashGap);
|
||||
ColorStateList cls(color);
|
||||
mGradientState->setStroke(width, &cls, dashWidth, dashGap);
|
||||
setStrokeInternal(width, color, dashWidth, dashGap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user