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

Commit 1f5ca7fe authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am 7b3cfebc: am f1fbe113: am 4ba1bbad: am 5fbcb134: am 35b7de4c: Merge "Cursor...

am 7b3cfebc: am f1fbe113: am 4ba1bbad: am 5fbcb134: am 35b7de4c: Merge "Cursor leakage due to cancellation signal"

* commit '7b3cfebc':
  Cursor leakage due to cancellation signal
parents ddf89c0c 7b3cfebc
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -112,17 +112,24 @@ abstract public class ContentProviderNative extends Binder implements IContentPr
                    Cursor cursor = query(callingPkg, url, projection, selection, selectionArgs,
                            sortOrder, cancellationSignal);
                    if (cursor != null) {
                        CursorToBulkCursorAdaptor adaptor = null;

                        try {
                            CursorToBulkCursorAdaptor adaptor = new CursorToBulkCursorAdaptor(
                                    cursor, observer, getProviderName());
                            BulkCursorDescriptor d = adaptor.getBulkCursorDescriptor();
                            adaptor = new CursorToBulkCursorAdaptor(cursor, observer,
                                    getProviderName());
                            cursor = null;

                            BulkCursorDescriptor d = adaptor.getBulkCursorDescriptor();
                            adaptor = null;

                            reply.writeNoException();
                            reply.writeInt(1);
                            d.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
                        } finally {
                            // Close cursor if an exception was thrown while constructing the adaptor.
                            if (adaptor != null) {
                                adaptor.close();
                            }
                            if (cursor != null) {
                                cursor.close();
                            }