diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-27 14:07:04 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-27 14:07:57 +0200 |
commit | ed2ce36735754b822e65d5cae8ac7b17ed6938be (patch) | |
tree | a1dc5ecdc810559c09b0a36e76a4523303a52dc4 /libs/ardour | |
parent | e1c421c67bba0e0cf8ea1d53fd82ec9b1af483a6 (diff) |
LV2 state cleanup, patch from deva. closes #6607
set _impl->state on session load in order to detect state changes
properly (no not save duplicate states).
+ some small mem-leaks (free state)
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index cd1c190c38..1c3db86db5 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -480,6 +480,7 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate) if (state && _has_state_interface) { lilv_state_restore(state, _impl->instance, NULL, NULL, 0, NULL); } + lilv_state_free(state); #endif _sample_rate = rate; @@ -682,6 +683,7 @@ LV2Plugin::~LV2Plugin () cleanup(); lilv_instance_free(_impl->instance); + lilv_state_free(_impl->state); lilv_node_free(_impl->name); lilv_node_free(_impl->author); free(_impl->options); @@ -1696,6 +1698,8 @@ LV2Plugin::set_state(const XMLNode& node, int version) _world.world, _uri_map.urid_map(), NULL, state_file.c_str()); lilv_state_restore(state, _impl->instance, NULL, NULL, 0, NULL); + lilv_state_free(_impl->state); + _impl->state = state; } latency_compute_run(); |