json2: export Value::clear (#584)

Export the existing clear implementation while preserving tree ownership and root handler metadata.
This commit is contained in:
ADBHXNLOL
2026-09-12 07:15:26 -04:00
committed by GitHub
parent a58db4f023
commit dff2b19c56
+16
View File
@@ -1006,6 +1006,21 @@ static int32_t KYTY_SYSV_ABI JsonValueCount(const JsonValue* self) {
}
}
static void KYTY_SYSV_ABI JsonValueClearMethod(void* self) {
PRINT_NAME();
LOGF("\t self = 0x%016" PRIx64 "\n", reinterpret_cast<uint64_t>(self));
auto* value = reinterpret_cast<JsonValue*>(self);
if (value != nullptr) {
auto* parent = value->parent;
auto* rootparam = value->rootparam;
JsonValueClear(value);
value->parent = parent;
value->rootparam = rootparam;
}
}
LIB_DEFINE(InitNet_1_Json2) {
LIB_FUNC("-hJRce8wn1U", LibJson2::JsonMemAllocatorCtor);
LIB_FUNC("WSOuge5IsCg", LibJson2::JsonInitParameter2Ctor);
@@ -1076,6 +1091,7 @@ LIB_DEFINE(InitNet_1_Json2) {
LIB_FUNC("RBw+4NukeGQ", LibJson2::JsonValueCount);
LIB_FUNC("+drDFyAS6u4", LibJson2::JsonInitializerSetGlobalNullAccessCallback);
LIB_FUNC("00oCq0RwSAY", LibJson2::JsonInitializerSetGlobalNullAccessCallback);
LIB_FUNC("FIjXN2TkuTs", LibJson2::JsonValueClearMethod);
}
} // namespace LibJson2