From 82fa29bfc5cbfe210345f17fab6341fae0870c0b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 11 Mar 2014 17:47:05 +0100 Subject: [PATCH] possible fix for #9 --- src/eu/siacs/conversations/persistance/DatabaseBackend.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java index e2067141c..81d4e4fb9 100644 --- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -3,6 +3,7 @@ package eu.siacs.conversations.persistance; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.CopyOnWriteArrayList; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; @@ -120,7 +121,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { } public List getMessages(Conversation conversation, int limit) { - List list = new ArrayList(); + List list = new CopyOnWriteArrayList(); SQLiteDatabase db = this.getReadableDatabase(); String[] selectionArgs = { conversation.getUuid() }; Cursor cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION