summaryrefslogtreecommitdiffstats
path: root/src/pluginuiinstance.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-02-09 23:59:35 +0000
committerDavid Robillard <d@drobilla.net>2008-02-09 23:59:35 +0000
commitac3da90ab3b2852f34e0710c9b31000ef56259dd (patch)
tree7caf89271f30f9a866fdb830aa5cb92c96ec2ca4 /src/pluginuiinstance.c
parentdab3cc86e17e863b7603ac434741c4e83fe7dbbd (diff)
downloadlilv-ac3da90ab3b2852f34e0710c9b31000ef56259dd.tar.gz
lilv-ac3da90ab3b2852f34e0710c9b31000ef56259dd.tar.bz2
lilv-ac3da90ab3b2852f34e0710c9b31000ef56259dd.zip
Gracefully handle UIs that fail to instantiate.
git-svn-id: http://svn.drobilla.net/lad/slv2@1140 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/pluginuiinstance.c')
-rw-r--r--src/pluginuiinstance.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c
index f87f4b7..ad96962 100644
--- a/src/pluginuiinstance.c
+++ b/src/pluginuiinstance.c
@@ -109,11 +109,9 @@ slv2_ui_instantiate(SLV2Plugin plugin,
}
}
- assert(result);
- assert(slv2_plugin_get_num_ports(plugin) > 0);
// Failed to instantiate
- if (result->pimpl->lv2ui_handle == NULL) {
+ if (result == NULL || result->pimpl->lv2ui_handle == NULL) {
//printf("Failed to instantiate %s\n", plugin->plugin_uri);
free(result);
return NULL;
@@ -136,6 +134,9 @@ slv2_ui_instantiate(SLV2Plugin plugin,
void
slv2_ui_instance_free(SLV2UIInstance instance)
{
+ if (instance == NULL)
+ return;
+
struct _SLV2UIInstance* i = (struct _SLV2UIInstance*)instance;
i->pimpl->lv2ui_descriptor->cleanup(i->pimpl->lv2ui_handle);
i->pimpl->lv2ui_descriptor = NULL;