Fix concurrent modification

This commit is contained in:
J-Jamet committed 2020-09-15 21:59:16 +02:00
1 parent 3f33733f40
commit 98ad33a589
2 files changed
+2 -5

No files matched your search

@@ -450,6 +450,7 @@ class Entry : Node, EntryVersionedInterface<Group> {
database?.startManageEntry(this)
removeAllFields()
removeAllAttachments()
// NodeId stay as is
title = newEntryInfo.title
icon = newEntryInfo.icon
@@ -461,8 +462,6 @@ class Entry : Node, EntryVersionedInterface<Group> {
notes = newEntryInfo.notes
addExtraFields(newEntryInfo.customFields)
database?.binaryPool?.let { binaryPool ->
// TODO Concurrent modification
// removeAllAttachments()
addAttachments(binaryPool, newEntryInfo.attachments)
}
@@ -310,9 +310,7 @@ class EntryKDBX : EntryVersioned<UUID, UUID, GroupKDBX, EntryKDBX>, NodeKDBXInte
}
fun removeAttachments() {
binaries.keys.forEach {
binaries.remove(it)
}
binaries.clear()
}
private fun getAttachmentsSize(binaryPool: BinaryPool): Long {