From 2f745fae447200b666c9f5810796d13a20fdf559 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 11 Jul 2016 20:26:39 -0400 Subject: Fully reset plugin struct when plugin is reloaded This fixes a bug where, for example, after re-loading a plugin from a different bundle, the LilvPlugin would still report the old bundle. Also never replace a newer version with an older version when a bundle is loaded. Ignores the entire bundle if an older plugin than one loaded is found. This is tricky because the unit of loading/unloading is a bundle, and the unit of versioning is a plugin, but since having data from an old bundle still loaded seems like a bad idea, this seems like the most correct behaviour. --- src/lilv_internal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lilv_internal.h') diff --git a/src/lilv_internal.h b/src/lilv_internal.h index ea96418..5abfcd4 100644 --- a/src/lilv_internal.h +++ b/src/lilv_internal.h @@ -1,5 +1,5 @@ /* - Copyright 2007-2015 David Robillard + Copyright 2007-2016 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -257,6 +257,7 @@ void lilv_port_free(const LilvPlugin* plugin, LilvPort* port); LilvPlugin* lilv_plugin_new(LilvWorld* world, LilvNode* uri, LilvNode* bundle_uri); +void lilv_plugin_clear(LilvPlugin* plugin, LilvNode* bundle_uri); void lilv_plugin_load_if_necessary(const LilvPlugin* p); void lilv_plugin_free(LilvPlugin* plugin); LilvNode* lilv_plugin_get_unique(const LilvPlugin* p, @@ -428,6 +429,10 @@ static const LV2_Feature* const dman_features = { NULL }; __func__) #define LILV_WARNF(fmt, ...) fprintf(stderr, "%s(): warning: " fmt, \ __func__, __VA_ARGS__) +#define LILV_NOTE(str) fprintf(stderr, "%s(): note: " str, \ + __func__) +#define LILV_NOTEF(fmt, ...) fprintf(stderr, "%s(): note: " fmt, \ + __func__, __VA_ARGS__) #ifdef __cplusplus } -- cgit v1.2.1