JsonArray::clear()
Description
JsonArray::clear() removes all elements from the array pointed by the JsonArray.
If the JsonArray is null/unbound, this function does nothing.
Causes memory leaks ⚠️
Because
JsonDocumentcontains a monotonic allocator, this function cannot release the memory associated with the removed value.
Consequently, you cannot call this function in a loop; otherwise, theJsonDocumentwill overflow.
Prefer JsonDocument::clear() which doesn’t leak memory.
Signatures
void clear() const;
