diff --git a/README.md b/README.md index e1b75fe..c84fd6c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,14 @@ The types that can be sent to the callback function are JSON_ARRAY, JSON_HASH, JSON_COMMA, and JSON_COLON. +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 json_free() +on the root 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: error is a str describing any errors found in the JSON, and line is the current line number being read from the input to make it easier to find the errors. +The root field points to the outer object of the current parse tree. + Utility function ----------------