am f1fbe113
: am 4ba1bbad
: am 5fbcb134
: am 35b7de4c
: Merge "Cursor leakage due to cancellation signal"
* commit 'f1fbe1135a2872a7287f5c06af211cf780f16598': Cursor leakage due to cancellation signal
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user