summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-21 21:12:45 +0200
committerDavid Robillard <d@drobilla.net>2019-06-21 21:12:45 +0200
commit6d0995694ca5a3de916cc9746f4104f066b22718 (patch)
tree0df02301fd180f5be983757f8d57a67150351c9c /src
parent630ee8c69bb755cf3b3882554602f249e7757964 (diff)
downloadlilv-6d0995694ca5a3de916cc9746f4104f066b22718.tar.gz
lilv-6d0995694ca5a3de916cc9746f4104f066b22718.tar.bz2
lilv-6d0995694ca5a3de916cc9746f4104f066b22718.zip
Refuse to store duplicate properties when saving plugin state
Diffstat (limited to 'src')
-rw-r--r--src/state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index e5c789b..9b44c42 100644
--- a/src/state.c
+++ b/src/state.c
@@ -192,6 +192,11 @@ store_callback(LV2_State_Handle handle,
uint32_t flags)
{
LilvState* const state = (LilvState*)handle;
+
+ if (find_property((const LilvState*)handle, key)) {
+ return LV2_STATE_ERR_UNKNOWN; // TODO: Add status for duplicate keys
+ }
+
append_property(state, &state->props, key, value, size, type, flags);
return LV2_STATE_SUCCESS;
}