1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-28 04:02:19 -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

@ -2287,6 +2287,8 @@ public class MessageList
} }
} }
public void pruneDirtyMessages() public void pruneDirtyMessages()
{
synchronized (mAdapter.messages)
{ {
Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator(); Iterator<MessageInfoHolder> iter = mAdapter.messages.iterator();
while (iter.hasNext()) while (iter.hasNext())
@ -2299,7 +2301,8 @@ public class MessageList
mSelectedCount--; mSelectedCount--;
toggleBatchButtons(); toggleBatchButtons();
} }
iter.remove(); mAdapter.removeMessage(holder);
}
} }
} }
} }