Skip to content

Commit 5503849

Browse files
authored
Merge pull request #4627 from andrew659/develop
fixed database cursor leaks
2 parents f3200df + 6fcfadb commit 5503849

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/MediaUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ public static Uri getLastRecordedVideoUri(Activity activity) {
112112
CursorLoader loader = new CursorLoader(activity, contentUri, proj, null, null, sortOrder);
113113
Cursor cursor = loader.loadInBackground();
114114
cursor.moveToFirst();
115+
long value = cursor.getLong(0);
116+
SqlUtils.closeCursor(cursor);
115117

116-
return Uri.parse(contentUri.toString() + "/" + cursor.getLong(0));
118+
return Uri.parse(contentUri.toString() + "/" + value);
117119
}
118120

119121
/**

0 commit comments

Comments
 (0)