summaryrefslogtreecommitdiffstats
path: root/src/client/PluginModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-23 23:51:44 +0000
committerDavid Robillard <d@drobilla.net>2011-09-23 23:51:44 +0000
commit4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e (patch)
treed2b874fb8e7437cf7ea819fa6faca36e1c3ddc9d /src/client/PluginModel.cpp
parent41f1be0a68676f33dc1d7dfbb32c5d6440ebd4c9 (diff)
downloadingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.tar.gz
ingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.tar.bz2
ingen-4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e.zip
Fix memory leaks and errors.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3482 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/PluginModel.cpp')
-rw-r--r--src/client/PluginModel.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 694e5ce0..80b78887 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -238,9 +238,11 @@ PluginModel::documentation() const
LilvNodes* vals = lilv_plugin_get_value(_lilv_plugin,
rdfs_comment);
- const LilvNode* val = lilv_nodes_get_first(vals);
- if (lilv_node_is_string(val)) {
- doc += lilv_node_as_string(val);
+ if (vals) {
+ const LilvNode* val = lilv_nodes_get_first(vals);
+ if (lilv_node_is_string(val)) {
+ doc += lilv_node_as_string(val);
+ }
}
lilv_node_free(rdfs_comment);
lilv_nodes_free(vals);
@@ -266,9 +268,11 @@ PluginModel::port_documentation(uint32_t index) const
LilvNodes* vals = lilv_port_get_value(_lilv_plugin,
port,
rdfs_comment);
- const LilvNode* val = lilv_nodes_get_first(vals);
- if (lilv_node_is_string(val)) {
- doc += lilv_node_as_string(val);
+ if (vals) {
+ const LilvNode* val = lilv_nodes_get_first(vals);
+ if (lilv_node_is_string(val)) {
+ doc += lilv_node_as_string(val);
+ }
}
lilv_node_free(rdfs_comment);
lilv_nodes_free(vals);