File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
core/java/android/content Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,6 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> {
5050
5151 Cursor mCursor ;
5252
53- final static class CloseTask extends AsyncTask <Cursor , Void , Void > {
54- @ Override
55- protected Void doInBackground (Cursor ... params ) {
56- params [0 ].close ();
57- return null ;
58- }
59- }
60-
61- static void closeAsync (Cursor cursor ) {
62- CloseTask closeTask = new CloseTask ();
63- closeTask .executeOnExecutor (AsyncTask .THREAD_POOL_EXECUTOR , cursor );
64- }
65-
6653 /* Runs on a worker thread */
6754 @ Override
6855 public Cursor loadInBackground () {
@@ -90,7 +77,7 @@ public void deliverResult(Cursor cursor) {
9077 if (isReset ()) {
9178 // An async query came in while the loader is stopped
9279 if (cursor != null ) {
93- closeAsync ( cursor );
80+ cursor . close ( );
9481 }
9582 return ;
9683 }
@@ -102,7 +89,7 @@ public void deliverResult(Cursor cursor) {
10289 }
10390
10491 if (oldCursor != null && oldCursor != cursor && !oldCursor .isClosed ()) {
105- closeAsync ( oldCursor );
92+ oldCursor . close ( );
10693 }
10794 }
10895
@@ -162,7 +149,7 @@ protected void onStopLoading() {
162149 @ Override
163150 public void onCanceled (Cursor cursor ) {
164151 if (cursor != null && !cursor .isClosed ()) {
165- closeAsync ( cursor );
152+ cursor . close ( );
166153 }
167154 }
168155
@@ -174,7 +161,7 @@ protected void onReset() {
174161 onStopLoading ();
175162
176163 if (mCursor != null && !mCursor .isClosed ()) {
177- closeAsync ( mCursor );
164+ mCursor . close ( );
178165 }
179166 mCursor = null ;
180167 }
You can’t perform that action at this time.
0 commit comments