aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-05-05 09:43:57 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit4711fdf527f416faee8ff19e15f050d4b48dcfb2 (patch)
tree6b18712ec44cce5713ddef1a21aec5f12651d901 /src/writer.c
parent248a874d7425749d29cf900a1c3783c624ea8d8c (diff)
downloadserd-4711fdf527f416faee8ff19e15f050d4b48dcfb2.tar.gz
serd-4711fdf527f416faee8ff19e15f050d4b48dcfb2.tar.bz2
serd-4711fdf527f416faee8ff19e15f050d4b48dcfb2.zip
[WIP] Generalize node construction API
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/writer.c b/src/writer.c
index 6d52b4e6..1de5e055 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -18,6 +18,7 @@
#include "serd/env.h"
#include "serd/event.h"
#include "serd/log.h"
+#include "serd/memory.h"
#include "serd/node.h"
#include "serd/output_stream.h"
#include "serd/sink.h"
@@ -1430,12 +1431,14 @@ serd_writer_set_root_uri(SerdWriter* writer, const SerdStringView uri)
{
assert(writer);
- serd_node_free(writer->world->allocator, writer->root_node);
+ SerdAllocator* const allocator = writer->world->allocator;
+
+ serd_node_free(allocator, writer->root_node);
writer->root_node = NULL;
writer->root_uri = SERD_URI_NULL;
if (uri.length) {
- writer->root_node = serd_new_uri(writer->world->allocator, uri);
+ writer->root_node = serd_node_new(allocator, serd_a_uri(uri));
writer->root_uri = serd_node_uri_view(writer->root_node);
}