mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-10-31 13:00:51 +00:00
update cJSON_SetValuestring and testcase
This commit is contained in:
1 parent
34e102d0dc
commit
31c7880fab
4 files changed
+36
-24
No files matched your search
@@ -212,7 +212,7 @@ For every value type there is a `cJSON_Create...` function that can be used to c
|
||||
All of these will allocate a `cJSON` struct that can later be deleted with `cJSON_Delete`.
|
||||
Note that you have to delete them at some point, otherwise you will get a memory leak.
|
||||
**Important**: If you have added an item to an array or an object already, you **mustn't** delete it with `cJSON_Delete`. Adding it to an array or object transfers its ownership so that when that array or object is deleted,
|
||||
it gets deleted as well. You also could use `cJSON_SetValuestringToObject` to change a `cJSON_Object`'s `valuestring`, and you needn't to free the previous `valuestring` manually.
|
||||
it gets deleted as well. You also could use `cJSON_SetValuestring` to change a `cJSON_String`'s `valuestring`, and you needn't to free the previous `valuestring` manually.
|
||||
|
||||
#### Basic types
|
||||
|
||||
|
||||
Reference in new issue
Block a user