From 283d5058e5f91e11fc651a83ce2968580bd94d4a Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 17 Nov 2014 20:01:56 +0100 Subject: synchronized around cache clear in avatar service --- .../conversations/services/AvatarService.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/services') diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index fc1ed28ea..b8154d655 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -58,9 +58,11 @@ public class AvatarService { } public void clear(Contact contact) { - for (Integer size : sizes) { - this.mXmppConnectionService.getBitmapCache().remove( - key(contact, size)); + synchronized (this.sizes) { + for (Integer size : sizes) { + this.mXmppConnectionService.getBitmapCache().remove( + key(contact, size)); + } } } @@ -150,9 +152,11 @@ public class AvatarService { } public void clear(MucOptions options) { - for (Integer size : sizes) { - this.mXmppConnectionService.getBitmapCache().remove( - key(options, size)); + synchronized (this.sizes) { + for (Integer size : sizes) { + this.mXmppConnectionService.getBitmapCache().remove( + key(options, size)); + } } } @@ -182,9 +186,11 @@ public class AvatarService { } public void clear(Account account) { - for (Integer size : sizes) { - this.mXmppConnectionService.getBitmapCache().remove( - key(account, size)); + synchronized (this.sizes) { + for (Integer size : sizes) { + this.mXmppConnectionService.getBitmapCache().remove( + key(account, size)); + } } } -- cgit v1.2.3