Merge "Fix resource leakage caused by cursor"

This commit is contained in:
Treehugger Robot
2023-06-01 22:10:34 +00:00
committed by Gerrit Code Review

View File

@@ -94,6 +94,8 @@ public class UserDictionaryCursorLoader extends CursorLoader {
hashSet.add(hash); hashSet.add(hash);
result.addRow(new Object[]{id, word, shortcut}); result.addRow(new Object[]{id, word, shortcut});
} }
// The cursor needs to be closed after use, otherwise it will cause resource leakage
candidate.close();
return result; return result;
} }
} }