Closed Sunslash closed 4 years ago
Hello, I am currently writing an application using jansson, and I would like to avoid any memory issues.
Let's say I have added a key to a json object json_object_set_new(my_json, "key", my_value);
json_object_set_new(my_json, "key", my_value);
And then later decide to replace the value json_object_set(my_json, "key", my_new_value);
json_object_set(my_json, "key", my_new_value);
What happens to the old json object ? Is it decremented and destroyed ? Or should I manage this myself ?
Yep, it will be decremented and destroyed. Stacktrace:
Perfect, thanks
Hello, I am currently writing an application using jansson, and I would like to avoid any memory issues.
Let's say I have added a key to a json object
json_object_set_new(my_json, "key", my_value);
And then later decide to replace the value
json_object_set(my_json, "key", my_new_value);
What happens to the old json object ? Is it decremented and destroyed ? Or should I manage this myself ?