diff options
author | David Robillard <d@drobilla.net> | 2007-05-04 05:19:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-05-04 05:19:20 +0000 |
commit | 553944b6460880259ae3216e2a6637efa22e3463 (patch) | |
tree | ff11df306c5f2fdad8f889b15cd6ce60d1b99370 /src | |
parent | dc5226d345c4bd24ddaae8fc00390b3dcf6eeae8 (diff) | |
download | raul-553944b6460880259ae3216e2a6637efa22e3463.tar.gz raul-553944b6460880259ae3216e2a6637efa22e3463.tar.bz2 raul-553944b6460880259ae3216e2a6637efa22e3463.zip |
Redland failed assertion fixes.
git-svn-id: http://svn.drobilla.net/lad/raul@496 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/RDFModel.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/RDFModel.cpp b/src/RDFModel.cpp index d1a1c64..9d8fac1 100644 --- a/src/RDFModel.cpp +++ b/src/RDFModel.cpp @@ -57,11 +57,22 @@ Model::Model(World& world, const Glib::ustring& data_uri, Glib::ustring base_uri librdf_uri* base_uri = NULL; if (base_uri_str != "") base_uri = librdf_new_uri(world.world(), (const unsigned char*)base_uri_str.c_str()); - librdf_parser* parser = librdf_new_parser(world.world(), "guess", NULL, NULL); - librdf_parser_parse_into_model(parser, uri, base_uri, _model); - librdf_free_uri(base_uri); - librdf_free_uri(uri); - librdf_free_parser(parser); + + if (uri) { + librdf_parser* parser = librdf_new_parser(world.world(), "guess", NULL, NULL); + librdf_parser_parse_into_model(parser, uri, base_uri, _model); + + + librdf_free_parser(parser); + } else { + cerr << "Unable to create URI " << data_uri << endl; + } + + if (base_uri) + librdf_free_uri(base_uri); + + if (uri) + librdf_free_uri(uri); /*cout << endl << "Loaded model from " << data_uri << ":" << endl; serialize_to_file_handle(stdout); |