fix(ProfileContextMenu): stop leaking memory

- got removed in a recent refactoring, restore it
- when a context menu component is opened via `Global.openMenu()`, it
has to be destroyed manually
This commit is contained in:
Lukáš Tinkl 2024-10-02 14:54:11 +02:00 committed by Lukáš Tinkl
parent 2c46764829
commit 277f408e0c
4 changed files with 7 additions and 0 deletions

View File

@ -205,6 +205,7 @@ Item {
onRemoveFromGroup: { onRemoveFromGroup: {
root.store.removeMemberFromGroupChat(profileContextMenu.publicKey) root.store.removeMemberFromGroupChat(profileContextMenu.publicKey)
} }
onClosed: destroy()
} }
} }
} }

View File

@ -371,6 +371,7 @@ Item {
const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true) const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true)
Global.blockContactRequested(memberContextMenuView.publicKey, contactDetails) Global.blockContactRequested(memberContextMenuView.publicKey, contactDetails)
} }
onClosed: destroy()
} }
} }

View File

@ -89,6 +89,7 @@ SettingsContentBase {
const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true) const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true)
Global.blockContactRequested(contactContextMenu.publicKey, contactDetails) Global.blockContactRequested(contactContextMenu.publicKey, contactDetails)
} }
onClosed: destroy()
} }
} }
SearchBox { SearchBox {

View File

@ -1227,6 +1227,10 @@ Loader {
root.store.removeMemberFromGroupChat(profileContextMenu.publicKey) root.store.removeMemberFromGroupChat(profileContextMenu.publicKey)
} }
onOpened: root.setMessageActive(root.messageId, true) onOpened: root.setMessageActive(root.messageId, true)
onClosed: {
root.setMessageActive(root.messageId, false)
destroy()
}
} }
} }
Component { Component {