From 500fab47e5e9aadb6e09a71a6c3447e97f3a6d6a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 20 Apr 2007 04:07:15 +0000 Subject: Fix memory leaks. Make slv2_world_get_all_plugins O(1). git-svn-id: http://svn.drobilla.net/lad/slv2@462 a436a847-0d15-0410-975c-d299462d15a1 --- src/world.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/world.c b/src/world.c index e10e7d4..a682a35 100644 --- a/src/world.c +++ b/src/world.c @@ -228,6 +228,7 @@ slv2_world_load_all(SLV2World world) librdf_free_node(plugin_node); librdf_free_node(data_node); + librdf_free_node(binary_node); librdf_query_results_next(results); } @@ -266,18 +267,7 @@ slv2_world_serialize(const char* filename) SLV2Plugins slv2_world_get_all_plugins(SLV2World world) { - // FIXME: Slow.. - - // NULL deleter so user can free returned sequence without nuking - // our locally stored plugins - raptor_sequence* result = raptor_new_sequence(NULL, NULL); - - for (int i=0; i < raptor_sequence_size(world->plugins); ++i) - raptor_sequence_push(result, raptor_sequence_get_at(world->plugins, i)); - - // sorted? - - return result; + return world->plugins; } -- cgit v1.2.1