From 7abf5062612d15f457a9246b90393dab769437a6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 13 Jul 2016 00:25:45 +0100 Subject: [PATCH] Free memory when plugin windows closed --- src/plugins/api.c | 3 +++ src/ui/window.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/plugins/api.c b/src/plugins/api.c index a5f5deea..44182440 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -303,6 +303,9 @@ api_win_create( void(*callback_destroy)(void *callback)) { if (callbacks_win_exists(plugin_name, tag)) { + if (callback_destroy) { + callback_destroy(callback); + } return; } diff --git a/src/ui/window.c b/src/ui/window.c index 2bbb327c..3325a1d0 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -452,6 +452,7 @@ win_free(ProfWin* window) { ProfPluginWin *pluginwin = (ProfPluginWin*)window; free(pluginwin->tag); + free(pluginwin->plugin_name); break; } default: