Skip to content

json destructor does not use the provided allocator #4842

@veselink1

Description

@veselink1

Description

The non-recursive destruction implementation uses a std::vector as a stack to avoid recursive destruction of nested objects.

The vector that is used does not use the provided allocator type.

Reproduction steps

json j = {
  {"object", {
    {"currency", "USD"},
    {"value", 42.99}
  }}
};

// j goes out of scope

basic_json::destroy is called from ~basic_json and uses a vector as a stack for the "object".

Expected vs. actual results

I expected the operation to use the given allocator to allocate the vector of basic_json, but it just uses new/delete.

Minimal code example

Error messages

Compiler and operating system

Apple clang version 15.0.0 / macOS

Library version

v3.12.0

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions