aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/jalv_gtk.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index b20305f..b6c9c5b 100644
--- a/NEWS
+++ b/NEWS
@@ -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));