JsonDocument::clear() empties JsonDocument.

Unlike JsonArray::clear() and JsonObject::clear(), this function doesn’t need to perform any housekeeping so it’s a bit faster.

You don’t need to call JsonDocument::clear():

These functions already clear the memory pool, so you don’t need to call JsonDocument::clear().

Every reference (JsonArray, JsonObject, or JsonVariant) acquired before calling clear() is invalidated.


void clear();

See also