diff options
author | David Robillard <d@drobilla.net> | 2011-04-29 02:03:23 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-29 02:03:23 +0000 |
commit | 8bc9aca63644d63de3ccccbb4752e79d3d3c7854 (patch) | |
tree | 7f8e4be2eab57edc3d422ad5a8d34c6ed6473b9d /src/client/NodeModel.cpp | |
parent | 77d22f06129e91f51e37c09c71c0917a0136dd7d (diff) | |
download | ingen-8bc9aca63644d63de3ccccbb4752e79d3d3c7854.tar.gz ingen-8bc9aca63644d63de3ccccbb4752e79d3d3c7854.tar.bz2 ingen-8bc9aca63644d63de3ccccbb4752e79d3d3c7854.zip |
Don't hide pointers behind typedefs.
Use const appropriately in API (makes it clear from the type whether objects should be freed or not).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3222 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/NodeModel.cpp')
-rw-r--r-- | src/client/NodeModel.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index f7321472..4c00e6ec 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -217,15 +217,18 @@ NodeModel::port_label(SharedPtr<PortModel> port) const #ifdef HAVE_LILV if (_plugin && _plugin->type() == PluginModel::LV2) { - LilvWorld c_world = _plugin->lilv_world(); - LilvPlugin c_plugin = _plugin->lilv_plugin(); - LilvValue c_sym = lilv_value_new_string(c_world, port->symbol().c_str()); - LilvPort c_port = lilv_plugin_get_port_by_symbol(c_plugin, c_sym); + LilvWorld* c_world = _plugin->lilv_world(); + const LilvPlugin* c_plugin = _plugin->lilv_plugin(); + LilvValue* c_sym = lilv_value_new_string(c_world, port->symbol().c_str()); + const LilvPort* c_port = lilv_plugin_get_port_by_symbol(c_plugin, c_sym); if (c_port) { - LilvValue c_name = lilv_port_get_name(c_plugin, c_port); + LilvValue* c_name = lilv_port_get_name(c_plugin, c_port); if (c_name && lilv_value_is_string(c_name)) { - return lilv_value_as_string(c_name); + std::string ret(lilv_value_as_string(c_name)); + lilv_value_free(c_name); + return ret; } + lilv_value_free(c_name); } } #endif |