json_decoder_cleanup()

Clean up a JSON decoder instance, freeing any memory allocated for the decoder tree

Synopsis:

#include <sys/json.h>
void json_decoder_cleanup(json_decoder_t *decoder);

Arguments:

decoder
The JSON decoder instance.

Library:

libjson

Description:

This function cleans up a JSON decoder instance, freeing any memory allocated for the decoder tree. Calling this function is not typically required, as the decoder is cleaned up when json_decoder_destroy() is called. It may be used to reduce memory usage if particularly large strings are parsed and it is not desirable to destroy the decoder itself. Calls to json_decoder_parse_json_str() make use of already allocated memory, so there is no need to call json_decoder_cleanup() before calling this other function.