aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-11-14 23:15:53 -0500
committerCorey Farrell <git@cfware.com>2017-12-13 14:04:07 -0500
commit6c78910011c5d10b9fcb95b6fdd038f4aa9bf74d (patch)
tree2f110743af935cdf56129e86b77e77a7e150dbb2 /doc
parent89dad8959b7903b1ab3653d11b3bd4335c44015e (diff)
downloadjansson-6c78910011c5d10b9fcb95b6fdd038f4aa9bf74d.zip
jansson-6c78910011c5d10b9fcb95b6fdd038f4aa9bf74d.tar.gz
jansson-6c78910011c5d10b9fcb95b6fdd038f4aa9bf74d.tar.bz2
apiref: Clarify documentation for unpack `O` format.
The `O` format causes reference counts to increase, but in an error they are not released. Callers to unpack functions that use the `O` format should use pointers pre-initialized to NULL so they can safely release the reference on error. Also corrected typo which said this was like `O` (itself). Fixes #135
Diffstat (limited to 'doc')
-rw-r--r--doc/apiref.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/apiref.rst b/doc/apiref.rst
index 7afeb21..a8cf8d6 100644
--- a/doc/apiref.rst
+++ b/doc/apiref.rst
@@ -1564,7 +1564,10 @@ type whose address should be passed.
Store a JSON value with no conversion to a :type:`json_t` pointer.
``O`` (any value) [json_t \*]
- Like ``O``, but the JSON value's reference count is incremented.
+ Like ``o``, but the JSON value's reference count is incremented.
+ Storage pointers should be initialized NULL before using unpack.
+ The caller is responsible for releasing all references incremented
+ by unpack, even when an error occurs.
``[fmt]`` (array)
Convert each item in the JSON array according to the inner format