[redland-dev] referencing models from queries

Maxence Guesdon Maxence.Guesdon at inria.fr
Wed Dec 7 18:50:33 CET 2011


Hello,

For my ocaml-rdf bindings, I encounter the following problem:

I create a model, then a query and execute the query. If the model was
freed (because it was reclaimed by the garbage collector which then calls
the librdf_free_model function), it seems that the model reference in the query
becomes invalid (I get a segfault).

The attached patch (apparently) solves the problem, but is it the right way
to go ?
What it does: increment reference count to model when executing the query,
free the model when terminating the query.

Regards, 

-- 
Maxence Guesdon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reference_model.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
Url : http://lists.librdf.org/pipermail/redland-dev/attachments/20111207/84cb2a8a/attachment.bin 


More information about the redland-dev mailing list