Skip to content

Commit a90739c

Browse files
committed
清除Drawable问题
1 parent b2fc457 commit a90739c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

composition-avatar/src/main/java/cn/yiiguxing/compositionavatar/CompositionAvatarView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ public Drawable removeDrawableAt(int index) {
288288
*/
289289
public void clearDrawable() {
290290
if (!mDrawables.isEmpty()) {
291+
for (AvatarDrawable drawable : mDrawables) {
292+
drawable.mDrawable.setCallback(null);
293+
unscheduleDrawable(drawable.mDrawable);
294+
}
291295
mDrawables.clear();
292296
layoutDrawables();
293297
}

0 commit comments

Comments
 (0)