Fix NPE caused by I34451000
It's unfortunate but some of the fields we cleared in I34451000 are accessed in BG threads or after the activity is destroyed. We could add != null checks everywhere, but it'll be a mess. I also think it's safer to simply remove the "= null" lines. On the other hand, clearing AsyncTasks are relatively safer because they are kept only so that we can cancel them afterwards, so I kept them. But let me know if you want to revert the original CL. Bug 2570603 Change-Id: I04a10dd7382bfcceb686c3e9af92f8949caf619e
This commit is contained in:
parent
60ee205963
commit
78e06eb894
|
@ -214,11 +214,9 @@ public class AccountFolderList extends ListActivity implements OnItemClickListen
|
|||
Utility.cancelTask(mDeleteAccountTask, false); // Don't interrupt if it's running.
|
||||
mDeleteAccountTask = null;
|
||||
|
||||
mListAdapter.changeCursor(null);
|
||||
mListAdapter = null;
|
||||
|
||||
mHandler = null;
|
||||
mControllerCallback = null;
|
||||
if (mListAdapter != null) {
|
||||
mListAdapter.changeCursor(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
|
|
@ -199,9 +199,6 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
|
|||
mMessageCountTask = null;
|
||||
|
||||
mListAdapter.changeCursor(null);
|
||||
mListAdapter = null;
|
||||
mHandler = null;
|
||||
mControllerCallback = null;
|
||||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -396,18 +396,13 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
|
||||
if (mAddressAdapterTo != null) {
|
||||
mAddressAdapterTo.changeCursor(null);
|
||||
mAddressAdapterTo = null;
|
||||
}
|
||||
if (mAddressAdapterCc != null) {
|
||||
mAddressAdapterCc.changeCursor(null);
|
||||
mAddressAdapterCc = null;
|
||||
}
|
||||
if (mAddressAdapterBcc != null) {
|
||||
mAddressAdapterBcc.changeCursor(null);
|
||||
mAddressAdapterBcc = null;
|
||||
}
|
||||
mHandler = null;
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -328,9 +328,6 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
|
|||
mSetFooterTask = null;
|
||||
|
||||
mListAdapter.changeCursor(null);
|
||||
mListAdapter = null;
|
||||
mHandler = null;
|
||||
mControllerCallback = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -502,9 +502,6 @@ public class MessageView extends Activity implements OnClickListener {
|
|||
mMessageContentView = null;
|
||||
}
|
||||
// the cursor was closed in onPause()
|
||||
|
||||
mHandler = null;
|
||||
mControllerCallback = null;
|
||||
}
|
||||
|
||||
private void onDelete() {
|
||||
|
|
Loading…
Reference in New Issue