summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-09-12 03:41:34 +0000
committerDavid Robillard <d@drobilla.net>2015-09-12 03:41:34 +0000
commitf18371240cf3d32940e9a67844505b46006e0788 (patch)
tree89f570ac6eadb87594cd72ee43c7d5257498f907
parent36b470397a178ca64bc6d98ecc652aaa7671c938 (diff)
downloadsuil-f18371240cf3d32940e9a67844505b46006e0788.tar.gz
suil-f18371240cf3d32940e9a67844505b46006e0788.tar.bz2
suil-f18371240cf3d32940e9a67844505b46006e0788.zip
Gracefully handle failure to open wrapper.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5724 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS5
-rw-r--r--src/instance.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 8cfcb40..19faa92 100644
--- a/NEWS
+++ b/NEWS
@@ -4,10 +4,11 @@ suil (0.8.3) unstable;
* Add Cocoa in Gtk wrapper (patch from Robin Gareus)
* Various Windows fixes (patches from Robin Gareus)
* Fix compilation with -Wl,--no-undefined
- * Fix a few minor/unlikely memory errors.
+ * Fix a few minor/unlikely memory errors
+ * Gracefully handle failure to open wrapper
* Only report suil_ui_supported() if necessary wrapper is compiled in
- -- David Robillard <d@drobilla.net> Thu, 14 May 2015 01:26:31 -0400
+ -- David Robillard <d@drobilla.net> Fri, 11 Sep 2015 17:38:26 -0400
suil (0.8.2) stable;
diff --git a/src/instance.c b/src/instance.c
index 4ace18c..a336dcb 100644
--- a/src/instance.c
+++ b/src/instance.c
@@ -65,10 +65,6 @@ open_wrapper(SuilHost* host,
LV2_Feature*** features,
unsigned n_features)
{
- if (!container_type_uri || !strcmp(container_type_uri, ui_type_uri)) {
- return NULL;
- }
-
const char* module_name = NULL;
#ifdef SUIL_WITH_GTK2_IN_QT4
if (!strcmp(container_type_uri, QT4_UI_URI)
@@ -254,8 +250,15 @@ suil_instance_new(SuilHost* host,
}
// Open wrapper (this may add additional features)
- instance->wrapper = open_wrapper(
- host, container_type_uri, ui_type_uri, &instance->features, n_features);
+ if (container_type_uri && strcmp(container_type_uri, ui_type_uri)) {
+ instance->wrapper = open_wrapper(host,
+ container_type_uri, ui_type_uri,
+ &instance->features, n_features);
+ if (!instance->wrapper) {
+ suil_instance_free(instance);
+ return NULL;
+ }
+ }
// Instantiate UI
instance->handle = descriptor->instantiate(