Fix race condition in testMultiple()
* If we close the activity while a requeryList() is pending in the handler queue, we'll eventually try to operate on a closed cursor when we get to testMultiple(). * The fix: Return immediately if the cursor is not available. Fixes bug http://b/2180416 Followup for bug http://b/2149083
This commit is contained in:
parent
2c74ee56a4
commit
754240bcf3
@ -752,6 +752,9 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
|
|||||||
*/
|
*/
|
||||||
private boolean testMultiple(Set<Long> selectedSet, int column_id, boolean defaultflag) {
|
private boolean testMultiple(Set<Long> selectedSet, int column_id, boolean defaultflag) {
|
||||||
Cursor c = mListAdapter.getCursor();
|
Cursor c = mListAdapter.getCursor();
|
||||||
|
if (c == null || c.isClosed()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
c.moveToPosition(-1);
|
c.moveToPosition(-1);
|
||||||
while (c.moveToNext()) {
|
while (c.moveToNext()) {
|
||||||
long id = c.getInt(MessageListAdapter.COLUMN_ID);
|
long id = c.getInt(MessageListAdapter.COLUMN_ID);
|
||||||
|
Loading…
Reference in New Issue
Block a user