mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Remove temp attachment if not used
This commit is contained in:
@@ -310,6 +310,7 @@ class EntryEditActivity : LockingActivity(),
|
||||
override fun onAttachmentAction(fileUri: Uri, entryAttachmentState: EntryAttachmentState) {
|
||||
when (entryAttachmentState.downloadState) {
|
||||
AttachmentState.START -> {
|
||||
mTempAttachments.add(entryAttachmentState.attachment)
|
||||
entryEditContentsView?.apply {
|
||||
// When only one attachment is allowed
|
||||
if (!mAllowMultipleAttachments) {
|
||||
@@ -322,7 +323,6 @@ class EntryEditActivity : LockingActivity(),
|
||||
scrollView?.smoothScrollTo(0, it.toInt())
|
||||
}
|
||||
}
|
||||
mTempAttachments.add(entryAttachmentState.attachment)
|
||||
}
|
||||
AttachmentState.IN_PROGRESS -> {
|
||||
entryEditContentsView?.putAttachment(entryAttachmentState)
|
||||
|
||||
@@ -598,8 +598,7 @@ class DatabaseKDBX : DatabaseVersioned<UUID, UUID, GroupKDBX, EntryKDBX> {
|
||||
binariesToRemove.forEach {
|
||||
try {
|
||||
binaryPool.remove(it)
|
||||
// bug with big attachment, not needed to be delete here
|
||||
// it.clear()
|
||||
it.clear()
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Unable to clean binaries", e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user