about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-13 00:25:45 +0100
committerJames Booth <boothj5@gmail.com>2016-07-13 00:25:45 +0100
commit7abf5062612d15f457a9246b90393dab769437a6 (patch)
treed89dcde4d347193dc524cab6c5753d7d65939242 /src
parent0991699ae65387dc67852a3f9d465de25d6067a0 (diff)
downloadprofani-tty-7abf5062612d15f457a9246b90393dab769437a6.tar.gz
Free memory when plugin windows closed
Diffstat (limited to 'src')
-rw-r--r--src/plugins/api.c3
-rw-r--r--src/ui/window.c1
2 files changed, 4 insertions, 0 deletions
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: