JsonDocument::clear()
clears the JsonDocument
and releases all the memory from the memory pool.
Unlike JsonArray::clear()
and JsonObject::clear()
, this function releases the memory from the memory pool; therefore, it doesn’t cause a memory leak.
This function resets the memory pool but doesn’t destroy it. The memory pool is still present in memory but is empty. If you want to release memory held by the memory pull, you must destroy the JsonDocument
.
If you use the library as intended (see the examples and the book), you don’t need to call this function.
You don’t need to call JsonDocument::clear()
:
JsonDocument
JsonDocument
deserializeJson()
or deserializeMsgPack()
JsonDocument::to<T>()
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.
JsonDocument::isNull()
JsonDocument::to<T>()
JsonDocument::garbageCollect()
JsonDocument
?RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4