Talk about error cleanup in README

This commit is contained in:
Eric Fischer 2014-02-08 09:57:55 -08:00
parent 5a01013642
commit 391db023e0

View File

@ -70,6 +70,14 @@ The types that can be sent to the callback function are
<code>JSON_ARRAY</code>, <code>JSON_HASH</code>, <code>JSON_COMMA</code>,
and <code>JSON_COLON</code>.
Cleanup
-------
If there was an error while parsing, the parser will have returned NULL before
all the containers were closed. You will probably want to call <code>json_free()</code>
on the <code>root</code> elemement of the parser, which should contain the full parse
tree so far, to avoid leaking memory.
Shutdown
--------
@ -103,6 +111,8 @@ The parser object has two fields of public interest: <code>error</code> is a str
describing any errors found in the JSON, and <code>line</code> is the current line number
being read from the input to make it easier to find the errors.
The <code>root</code> field points to the outer object of the current parse tree.
Utility function
----------------