Free memory when plugin windows closed

This commit is contained in:
James Booth
2016-07-13 00:25:45 +01:00
parent 0991699ae6
commit 7abf506261
2 changed files with 4 additions and 0 deletions

View File

@@ -303,6 +303,9 @@ api_win_create(
void(*callback_destroy)(void *callback)) void(*callback_destroy)(void *callback))
{ {
if (callbacks_win_exists(plugin_name, tag)) { if (callbacks_win_exists(plugin_name, tag)) {
if (callback_destroy) {
callback_destroy(callback);
}
return; return;
} }

View File

@@ -452,6 +452,7 @@ win_free(ProfWin* window)
{ {
ProfPluginWin *pluginwin = (ProfPluginWin*)window; ProfPluginWin *pluginwin = (ProfPluginWin*)window;
free(pluginwin->tag); free(pluginwin->tag);
free(pluginwin->plugin_name);
break; break;
} }
default: default: