mirror of
https://github.com/nlohmann/json.git
synced 2026-10-05 06:00:29 +00:00
Use the provided allocator in destroy() (#4842)
Uses the provided allocator to allocate the stack used to avoid recursion in the destroy() implementation used by ~basic_json. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
committed by
Niels Lohmann
parent
8c1f60a45e
commit
13d555538b
@@ -627,7 +627,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
if (t == value_t::array || t == value_t::object)
|
||||
{
|
||||
// flatten the current json_value to a heap-allocated stack
|
||||
std::vector<basic_json> stack;
|
||||
std::vector<basic_json, allocator_type> stack;
|
||||
|
||||
// move the top-level items to stack
|
||||
if (t == value_t::array)
|
||||
|
||||
Reference in New Issue
Block a user