diff options
author | David Robillard <d@drobilla.net> | 2020-01-18 15:49:06 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-01-18 15:49:06 +0100 |
commit | 807627ebaac9a763255e498c7a91bd556e424bf3 (patch) | |
tree | 3130360344e12cba3526d866f5b731681e18a97c /src/state.c | |
parent | 87cfe0eae77239874a03166dcfeeeea8456096a4 (diff) | |
download | lilv-807627ebaac9a763255e498c7a91bd556e424bf3.tar.gz lilv-807627ebaac9a763255e498c7a91bd556e424bf3.tar.bz2 lilv-807627ebaac9a763255e498c7a91bd556e424bf3.zip |
Update manifest when deleting state from a non-empty bundle
This fixes a bug where the manifest would contain dangling references to old
state if multiple states were saved to a single bundle and one is deleted.
As far as I know this has not been encountered by anyone in reality, since this
is an uncommon scenario (it's somewhat in question whether it should be
supported at all).
Diffstat (limited to 'src/state.c')
-rw-r--r-- | src/state.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c index cd47fe0..5ca2205 100644 --- a/src/state.c +++ b/src/state.c @@ -1305,8 +1305,13 @@ lilv_state_delete(LilvWorld* world, state->dir, strerror(errno)); } } else { - // Still something in the manifest, reload bundle + // Still something in the manifest, update and reload bundle + const SerdNode* manifest_node = sord_node_to_serd_node(manifest->node); + SerdEnv* env = serd_env_new(manifest_node); + + write_manifest(world, env, model, manifest_node); lilv_world_load_bundle(world, bundle); + serd_env_free(env); } sord_free(model); |