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

Commit 336a0ee9 authored by Josh Guilfoyle's avatar Josh Guilfoyle
Browse files

Fixed issue #4098: Ringtone#getTitle does not close its cursor.

parent 5550ef48
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -137,12 +137,18 @@ public class Ringtone {
                    cursor = res.query(uri, MEDIA_COLUMNS, null, null, null);
                }
                
                try {
                    if (cursor != null && cursor.getCount() == 1) {
                        cursor.moveToFirst();
                        return cursor.getString(2);
                    } else {
                        title = uri.getLastPathSegment();
                    }
                } finally {
                    if (cursor != null) {
                        cursor.close();
                    }
                }
            }
        }