mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 19:41:49 +00:00
Backed out changeset ca8d1e1caeef for not fixing review comments
I managed to land the unfixed version - we should be closing the cursor before adding a LeakCanary watcher, or else we have a greater probability of a race condition. MozReview-Commit-ID: JuP15Tkj1hz
This commit is contained in:
parent
4ca8060282
commit
51bde91b05
@ -23,8 +23,6 @@ import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.support.v4.content.AsyncTaskLoader;
|
||||
|
||||
import org.mozilla.gecko.GeckoApplication;
|
||||
|
||||
/**
|
||||
* A copy of the framework's {@link android.content.CursorLoader} that
|
||||
* instead allows the caller to load the Cursor themselves via the abstract
|
||||
@ -89,10 +87,6 @@ abstract class SimpleCursorLoader extends AsyncTaskLoader<Cursor> {
|
||||
}
|
||||
|
||||
if (oldCursor != null && oldCursor != cursor && !oldCursor.isClosed()) {
|
||||
// Trying to read from the closed cursor will cause crashes, hence we should make
|
||||
// sure that no adapters/LoaderCallbacks are holding onto this cursor.
|
||||
GeckoApplication.getRefWatcher(getContext()).watch(oldCursor);
|
||||
|
||||
oldCursor.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user