Merge pull request #3160 from andrew659/master

fix database cursor leak in GpxImportHelper.java
This commit is contained in:
vshcherb 2016-10-10 17:38:14 +03:00 committed by GitHub
commit cbd8283bfb

View file

@ -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;
}