From 277f408e0c7567480253d127927ea3137ec7af85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Wed, 2 Oct 2024 14:54:11 +0200 Subject: [PATCH] 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 --- ui/app/AppLayouts/Chat/panels/UserListPanel.qml | 1 + ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml | 1 + ui/app/AppLayouts/Profile/views/ContactsView.qml | 1 + ui/imports/shared/views/chat/MessageView.qml | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml index 6a5e0b5120..1c4a52a762 100644 --- a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml @@ -205,6 +205,7 @@ Item { onRemoveFromGroup: { root.store.removeMemberFromGroupChat(profileContextMenu.publicKey) } + onClosed: destroy() } } } diff --git a/ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml b/ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml index 1d175a36ec..5838160c63 100644 --- a/ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/MembersTabPanel.qml @@ -371,6 +371,7 @@ Item { const contactDetails = memberContextMenuView.publicKey === "" ? {} : Utils.getContactDetailsAsJson(memberContextMenuView.publicKey, true, true) Global.blockContactRequested(memberContextMenuView.publicKey, contactDetails) } + onClosed: destroy() } } diff --git a/ui/app/AppLayouts/Profile/views/ContactsView.qml b/ui/app/AppLayouts/Profile/views/ContactsView.qml index 1883ec573d..e79b7537bd 100644 --- a/ui/app/AppLayouts/Profile/views/ContactsView.qml +++ b/ui/app/AppLayouts/Profile/views/ContactsView.qml @@ -89,6 +89,7 @@ SettingsContentBase { const contactDetails = contactContextMenu.publicKey === "" ? {} : Utils.getContactDetailsAsJson(contactContextMenu.publicKey, true, true) Global.blockContactRequested(contactContextMenu.publicKey, contactDetails) } + onClosed: destroy() } } SearchBox { diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index f13d688025..37dd8fee91 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -1227,6 +1227,10 @@ Loader { root.store.removeMemberFromGroupChat(profileContextMenu.publicKey) } onOpened: root.setMessageActive(root.messageId, true) + onClosed: { + root.setMessageActive(root.messageId, false) + destroy() + } } } Component {