aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_titlebar
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-11-22 21:09:39 +0100
committerfiaxh <git@mx.ax.lt>2017-11-23 01:28:29 +0100
commit64774241e587eab64b10a0c35dd455f6a2288a55 (patch)
treee019252bce51a684dc1c97c97d897a193715d360 /main/src/ui/conversation_titlebar
parent9165c4db278b2d3da636d53e89c3b80cff66977f (diff)
downloaddino-64774241e587eab64b10a0c35dd455f6a2288a55.tar.gz
dino-64774241e587eab64b10a0c35dd455f6a2288a55.zip
Fix memory leak
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r--main/src/ui/conversation_titlebar/occupants_entry.vala8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/ui/conversation_titlebar/occupants_entry.vala b/main/src/ui/conversation_titlebar/occupants_entry.vala
index d6ce7f68..0646eee7 100644
--- a/main/src/ui/conversation_titlebar/occupants_entry.vala
+++ b/main/src/ui/conversation_titlebar/occupants_entry.vala
@@ -29,9 +29,9 @@ class OccupantsWidget : MenuButton, Plugins.ConversationTitlebarWidget {
private Conversation? conversation;
private StreamInteractor stream_interactor;
private Window window;
+ private OccupantMenu.View menu = null;
public OccupantsWidget(StreamInteractor stream_interactor, Window window) {
-
image = new Image.from_icon_name("system-users-symbolic", IconSize.MENU);
this.stream_interactor = stream_interactor;
@@ -44,8 +44,10 @@ class OccupantsWidget : MenuButton, Plugins.ConversationTitlebarWidget {
visible = conversation.type_ == Conversation.Type.GROUPCHAT;
if (conversation.type_ == Conversation.Type.GROUPCHAT) {
- OccupantMenu.View menu = new OccupantMenu.View(stream_interactor, window, conversation);
- set_popover(menu);
+ OccupantMenu.View new_menu = new OccupantMenu.View(stream_interactor, window, conversation);
+ set_popover(new_menu);
+ if (menu != null) menu.destroy();
+ menu = new_menu;
}
}
}