Fix resource leakage caused by cursor

Change-Id: I9507658cc82a2b9760507530920a37044f7de2fd
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
Cao Peng
2023-06-01 18:16:26 +08:00
committed by Jia Jia
parent b2b16851ef
commit 38f1b45d50

View File

@@ -94,6 +94,8 @@ public class UserDictionaryCursorLoader extends CursorLoader {
hashSet.add(hash);
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;
}
}