From e75478522b098a1016042a7538953f2ff2c3aadb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 12 Jan 2007 04:27:56 +0000 Subject: Gracefully handle plugins that fail to instantiate. git-svn-id: http://svn.drobilla.net/lad/slv2@250 a436a847-0d15-0410-975c-d299462d15a1 --- src/plugininstance.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- cgit v1.2.1