From 355adb117cf1e66eca95a162bb1986b4fd049043 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 7 Mar 2016 18:24:04 +0000 Subject: [PATCH] Added WIN_PLUGIN case to win_free() --- src/ui/window.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/ui/window.c b/src/ui/window.c index 05eaf586..f52ebc41 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -419,27 +419,42 @@ win_free(ProfWin* window) } free(window->layout); - if (window->type == WIN_CHAT) { + switch (window->type) { + case WIN_CHAT: + { ProfChatWin *chatwin = (ProfChatWin*)window; free(chatwin->barejid); free(chatwin->resource_override); chat_state_free(chatwin->state); + break; } - - if (window->type == WIN_MUC) { + case WIN_MUC: + { ProfMucWin *mucwin = (ProfMucWin*)window; free(mucwin->roomjid); + break; } - - if (window->type == WIN_MUC_CONFIG) { + case WIN_MUC_CONFIG: + { ProfMucConfWin *mucconf = (ProfMucConfWin*)window; free(mucconf->roomjid); form_destroy(mucconf->form); + break; } - - if (window->type == WIN_PRIVATE) { + case WIN_PRIVATE: + { ProfPrivateWin *privatewin = (ProfPrivateWin*)window; free(privatewin->fulljid); + break; + } + case WIN_PLUGIN: + { + ProfPluginWin *pluginwin = (ProfPluginWin*)window; + free(pluginwin->tag); + break; + } + default: + break; } free(window);