From 4dc86f78b2a8efb77ea85a4c39a2f34e69b85388 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 3 Sep 2018 18:16:08 +0000 Subject: [PATCH] Free message memory --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6ffe2f84..b90d430d 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1301,10 +1301,12 @@ public class ServiceSynchronize extends LifecycleService { if (imessage.isExpunged()) { Log.i(Helper.TAG, folder.name + " expunged uid=" + uid); + imessage.invalidateHeaders(); return 0; } if (imessage.isSet(Flags.Flag.DELETED)) { Log.i(Helper.TAG, folder.name + " deleted uid=" + uid); + imessage.invalidateHeaders(); return 0; } @@ -1395,6 +1397,9 @@ public class ServiceSynchronize extends LifecycleService { message.write(context, helper.getHtml()); Log.i(Helper.TAG, folder.name + " added id=" + message.id + " uid=" + message.uid); + // Free memory + imessage.invalidateHeaders(); + int sequence = 0; for (EntityAttachment attachment : helper.getAttachments()) { sequence++;