Fix: two memory leaks

Co-authored-by: NekoInverter <chsqwyx@gmail.com>
This commit is contained in:
xtaodada 2022-11-06 17:53:48 +08:00
parent f3a2340e11
commit fcceccadeb
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 2 additions and 1 deletions

View File

@ -941,6 +941,7 @@ public class EmojiPacksAlert extends BottomSheet implements NotificationCenter.N
@Override
public void dismiss() {
super.dismiss();
customEmojiPacks.recycle();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.startAllHeavyOperations, 4);
}

View File

@ -148,7 +148,7 @@ public class DownloadProgressIcon extends View implements NotificationCenter.Not
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
detachCurrentListeners();
NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.onDownloadingFilesChanged);
NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.onDownloadingFilesChanged);
downloadImageReceiver.onDetachedFromWindow();
downloadCompleteImageReceiver.onDetachedFromWindow();
}