Merge pull request #3160 from andrew659/master
fix database cursor leak in GpxImportHelper.java
This commit is contained in:
commit
cbd8283bfb
1 changed files with 3 additions and 1 deletions
|
@ -81,10 +81,12 @@ public class GpxImportHelper {
|
|||
final Cursor returnCursor = application.getContentResolver().query(contentUri, null, null, null, null);
|
||||
if (returnCursor != null && returnCursor.moveToFirst()) {
|
||||
name = returnCursor.getString(returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
|
||||
returnCursor.close();
|
||||
} else {
|
||||
name = null;
|
||||
}
|
||||
if (returnCursor != null && !returnCursor.isClosed()) {
|
||||
returnCursor.close();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue