1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Be more careful about deleting messages from the MessageListAdapter -

don't do it from something that's not the UI thread
This commit is contained in:
Jesse Vincent 2010-11-05 01:16:35 +00:00
parent 4aba667a4e
commit 602099cfd3

View File

@ -2288,20 +2288,23 @@ public class MessageList
}
public void pruneDirtyMessages()
{
Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator();
while (iter.hasNext())
synchronized (mAdapter.messages)
{
MessageInfoHolder holder = iter.next();
if (holder.dirty)
Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator();
while (iter.hasNext())
{
if (holder.selected)
MessageInfoHolder holder = iter.next();
if (holder.dirty)
{
mSelectedCount--;
toggleBatchButtons();
if (holder.selected)
{
mSelectedCount--;
toggleBatchButtons();
}
mAdapter.removeMessage(holder);
}
iter.remove();
}
}
}
}
public void removeMessages(List<MessageInfoHolder> holders)