[redland-dev] [Redland librdf RDF API 0000478]: Object returned from librdf_stream_get_object must be copied, but may not copiable
Mantis Bug Tracker
mantis-bug-sender at librdf.org
Sat Oct 29 21:30:45 CEST 2011
The following issue has been SUBMITTED.
======================================================================
http://bugs.librdf.org/mantis/view.php?id=478
======================================================================
Reported By: normang
Assigned To:
======================================================================
Project: Redland librdf RDF API
Issue ID: 478
Category: api
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2011-10-29 19:30
Last Modified: 2011-10-29 19:30
======================================================================
Summary: Object returned from librdf_stream_get_object must
be copied, but may not copiable
Description:
The documentation for librdf_stream_get_object says:
This method returns a SHARED pointer to the current statement object which
should be copied by the caller to preserve it if the stream is moved on
librdf_stream_next or if it should last after the stream is closed.
The obvious function to copy this is librdf_new_statement_from_statement, which
says:
Copy constructor - create a new librdf_statement from an existing
librdf_statement.
However, the 'copy' which this returns is not an independent copy, but, via
raptor_statement_copy, merely the original statement with an incremented usage
count (unless the input statement is static (usage < 0); see
raptor_statement_copy in
https://github.com/dajobe/raptor/blob/master/src/raptor_statement.c), and this
is confirmed by printing out pointers and usage counts of the statement returned
from librdf_new_statement_from_statement.
More information about the redland-dev
mailing list