Fix resource leakage caused by cursor
Change-Id: I9507658cc82a2b9760507530920a37044f7de2fd Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user