Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 851ec0eb authored by Ben Komalo's avatar Ben Komalo Committed by Android (Google) Code Review
Browse files

Merge "Release resources for a previously loaded cursor if a new one comes in."

parents 2ffb512a 8e6f69b0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -55,8 +55,13 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> {
            }
            return;
        }
        Cursor oldCursor = mCursor;
        mCursor = cursor;
        super.deliverResult(cursor);

        if (oldCursor != null && !oldCursor.isClosed()) {
            oldCursor.close();
        }
    }

    public CursorLoader(Context context, Uri uri, String[] projection, String selection,