summaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-25 06:07:21 +0000
committerDavid Robillard <d@drobilla.net>2007-07-25 06:07:21 +0000
commit66a7b635331baaa483ba3cc27aef6c244f9a98df (patch)
tree5a743732458a5ee194f12917b9f9479d42f3afa4 /src/world.c
parent9f43f23510ba2acd8e03f2822d87c74a8774b9d6 (diff)
downloadlilv-66a7b635331baaa483ba3cc27aef6c244f9a98df.tar.gz
lilv-66a7b635331baaa483ba3cc27aef6c244f9a98df.tar.bz2
lilv-66a7b635331baaa483ba3cc27aef6c244f9a98df.zip
Don't call librdf_free_world if world was passed by called using slv2_world_new_using_rdf_world.
git-svn-id: http://svn.drobilla.net/lad/slv2@623 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/world.c b/src/world.c
index d3776e5..26ca852 100644
--- a/src/world.c
+++ b/src/world.c
@@ -37,6 +37,8 @@ slv2_world_new()
world->world = librdf_new_world();
if (!world->world)
goto fail;
+
+ world->local_world = true;
librdf_world_open(world->world);
@@ -87,7 +89,11 @@ slv2_world_new_using_rdf_world(librdf_world* rdf_world)
SLV2World world = (SLV2World)malloc(sizeof(struct _SLV2World));
world->world = rdf_world;
+ if (!world->world)
+ goto fail;
+ world->local_world = false;
+
world->storage = librdf_new_storage(world->world, "hashes", NULL,
"hash-type='memory'");
if (!world->storage)
@@ -155,7 +161,9 @@ slv2_world_free(SLV2World world)
librdf_free_storage(world->storage);
world->storage = NULL;
- librdf_free_world(world->world);
+ if (world->local_world)
+ librdf_free_world(world->world);
+
world->world = NULL;
if (world->rdf_unlock)