Skip to content

Destruction of type number #34

@lu44anno

Description

@lu44anno

The following code crashes in JSONValue destructor ("CRT detected that the application wrote to memory after end of heap buffer" exception thrown).
Seems that number_value should be pointer to double and thus deleted in destructor.

void example2()
{
JSONObject root;

// Adding a string
root[L"test_string"] = new JSONValue(1.0); //or new JSONValue(1);

    // Create a value
JSONValue *value = new JSONValue(root);

// Print it
print_out(value->Stringify().c_str());

// Clean up
delete value;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions