diff options
author | David Robillard <d@drobilla.net> | 2007-01-12 04:27:56 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-01-12 04:27:56 +0000 |
commit | e75478522b098a1016042a7538953f2ff2c3aadb (patch) | |
tree | 72502f2a645c4cbdb2807af65bba729b8ead2f5f | |
parent | 0daf4c284a600ee8f2d7fae6454d1f9e99231cc4 (diff) | |
download | lilv-e75478522b098a1016042a7538953f2ff2c3aadb.tar.gz lilv-e75478522b098a1016042a7538953f2ff2c3aadb.tar.bz2 lilv-e75478522b098a1016042a7538953f2ff2c3aadb.zip |
Gracefully handle plugins that fail to instantiate.
git-svn-id: http://svn.drobilla.net/lad/slv2@250 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/plugininstance.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugininstance.c b/src/plugininstance.c index 9db7d26..edc6e4f 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -92,6 +92,13 @@ slv2_plugin_instantiate(const SLV2Plugin* plugin, assert(result); assert(slv2_plugin_get_num_ports(plugin) > 0); + // Failed to instantiate + if (result->lv2_handle == NULL) { + //printf("Failed to instantiate %s\n", plugin->plugin_uri); + free(result); + return NULL; + } + // "Connect" all ports to NULL (catches bugs) for (uint32_t i=0; i < slv2_plugin_get_num_ports(plugin); ++i) result->descriptor->connect_port(result->lv2_handle, i, NULL); |