MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / destroyDom

Method destroyDom

include/sonic/dom/generic_document.h:192–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 }
191
192 void destroyDom() {
193 if (!Allocator::kNeedFree) {
194 this->setType(kNull);
195 return;
196 }
197 // NOTE: must free dynamic nodes at first
198 reinterpret_cast<DNode<Allocator>*>(this)->~DNode();
199 Allocator::Free(str_);
200 Allocator::Free(schema_str_);
201 // Avoid Double Free
202 str_ = nullptr;
203 schema_str_ = nullptr;
204 this->setType(kNull);
205 }
206
207 template <unsigned parseFlags>
208 GenericDocument& parseImpl(const char* json, size_t len) {

Callers

nothing calls this directly

Calls 1

~DNodeMethod · 0.80

Tested by

no test coverage detected