diff options
author | David Robillard <d@drobilla.net> | 2016-09-16 16:39:11 -0700 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-16 16:39:11 -0700 |
commit | 25cdc0a3a8a7a947b66ea95e56afb306f5d0bbe6 (patch) | |
tree | cb12894f78100fba329c0a62fff563656f325c73 | |
parent | 701f67947d415feb416cfab83938380b063d6624 (diff) | |
download | jalv-25cdc0a3a8a7a947b66ea95e56afb306f5d0bbe6.tar.gz jalv-25cdc0a3a8a7a947b66ea95e56afb306f5d0bbe6.tar.bz2 jalv-25cdc0a3a8a7a947b66ea95e56afb306f5d0bbe6.zip |
Fix memory error on preset save
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/jalv_gtk.c | 13 |
2 files changed, 9 insertions, 7 deletions
@@ -2,6 +2,7 @@ jalv (1.4.7) unstable; * Support CV ports if Jack metadata is enabled (patch from Hanspeter Portner) * Fix unreliable UI state initialization (patch from Hanspeter Portner) + * Fix memory error on preset save resulting in odd bundle names * Improve preset support * Support numeric and string plugin properties (event-based control) * Support thread-safe state restoration @@ -19,7 +20,7 @@ jalv (1.4.7) unstable; * Use moc-qt4 if present for systems with multiple Qt versions * Add Qt5 version - -- David Robillard <d@drobilla.net> Wed, 31 Aug 2016 23:52:53 -0400 + -- David Robillard <d@drobilla.net> Fri, 16 Sep 2016 16:37:23 -0700 jalv (1.4.6) stable; diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index 82df8b4..3d7e2ab 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -400,15 +400,14 @@ on_save_preset_activate(GtkWidget* widget, void* ptr) gtk_entry_set_activates_default(GTK_ENTRY(uri_entry), TRUE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { - const char* path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - const char* uri = gtk_entry_get_text(GTK_ENTRY(uri_entry)); - const char* prefix = ""; - const char* sep = ""; + LilvNode* plug_name = lilv_plugin_get_name(jalv->plugin); + const char* path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + const char* uri = gtk_entry_get_text(GTK_ENTRY(uri_entry)); + const char* prefix = ""; + const char* sep = ""; if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_prefix))) { - LilvNode* plug_name = lilv_plugin_get_name(jalv->plugin); prefix = lilv_node_as_string(plug_name); sep = "_"; - lilv_node_free(plug_name); } char* dirname = g_path_get_dirname(path); @@ -434,9 +433,11 @@ on_save_preset_activate(GtkWidget* widget, void* ptr) g_free(dir); g_free(file); g_free(bundle); + free(sprefix); free(sym); g_free(basename); g_free(dirname); + lilv_node_free(plug_name); } gtk_widget_destroy(GTK_WIDGET(dialog)); |