Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Values after call to clear() fails. #1533

Open
VicKrawciw opened this issue Mar 8, 2024 · 0 comments
Open

Adding Values after call to clear() fails. #1533

VicKrawciw opened this issue Mar 8, 2024 · 0 comments

Comments

@VicKrawciw
Copy link

Describe the bug
Adding Values after call to clear() fails.

To Reproduce
Steps to reproduce the behavior:
1.
bool result = false;

Json::Value root;
Json::Reader reader;

result = reader.parse(request, request + strlen(request), root, false);
if (result)
{
std::string command;
int advanced;
try
{
command = root[0]["command"].asString();
advanced = root[0]["advanced"].asInt();

  //Done with command
  root.clear();

  if (command.compare("GetStationDesc") == 0)
  {
   // If we use the root above after clear() this addition fails.
    // Json::Value root;
    root["name"] = "S2000Test";
    root["type"] = "S2000";

Expected behavior
After the root.clear() I should be able to add items.

Desktop (please complete the following information):

  • OS: Embedded RTX with Keil compiler.
  • Meson version
  • Ninja version

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant