-
Notifications
You must be signed in to change notification settings - Fork 22
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
json_Merge(Objects) memleak #67
Comments
Hello - and thank you for the the feedback;
We have just made a simple use case and can confirm you are right. It
produces a memory leak. We will fix it as soon as possible.
Thank you again.
…On Tue, Apr 5, 2022 at 2:15 PM Helaas ***@***.***> wrote:
Hello,
I've been playing around with json_Merge(Objects).
I've noticed that json_Merge & json_MergeObjects cause json_MemLeak to
return true.
json_NodeClone does not have this behavior.
*json_MergeObjects*
pFrom = json_parseString ('{ -
"s" : "Life is a gift", -
"a" : [1,2,3,4], -
"o" : { -
"x" : 100, -
"y" : 200 -
} -
}');
// "to" is just an empty object at begining
pTo = json_newObject();
// copy all elements: This is deep copy
json_MergeObjects(pTo:pFrom:json_REPLACE);
Content = json_AsJsonText(pFrom);
Content2 = json_AsJsonText(pTo);
json_delete(pTo);
json_delete(pFrom);
*inlr = *on;
Memleak = json_MemLeak(); //Will return 1!
*json_Merge*
pFrom = json_parseString ('{ -
"s" : "Life is a gift", -
"a" : [1,2,3,4], -
"o" : { -
"x" : 100, -
"y" : 200 -
} -
}');
// "to" is just an empty object at begining
pTo = json_newObject();
// copy all elements: This is deep copy
json_Merge(pTo:pFrom:json_DONTREPLACE);
Content = json_AsJsonText(pFrom);
Content2 = json_AsJsonText(pTo);
json_delete(pTo);
json_delete(pFrom);
*inlr = *on;
Memleak = json_MemLeak(); //Will return 1!
*json_NodeClone*
pFrom = json_parseString ('{ -
"s" : "Life is a gift", -
"a" : [1,2,3,4], -
"o" : { -
"x" : 100, -
"y" : 200 -
} -
}');
// copy all elements: This is deep copy
pTo = json_NodeClone(pFrom)
Content = json_AsJsonText(pFrom);
Content2 = json_AsJsonText(pTo);
json_delete(pTo);
json_delete(pFrom);
*inlr = *on;
Memleak = json_MemLeak(); //Will return 0!
—
Reply to this email directly, view it on GitHub
<#67>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVIPHQEPVJZR7HICZ4R4U3VDQVEDANCNFSM5SSRYPAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@NielsLiisberg What's the status here? |
Unfortunately we have not had time to fix it yet - It is on the TODO list - it is not forgotten. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I've been playing around with json_Merge(Objects).
I've noticed that json_Merge & json_MergeObjects cause json_MemLeak to return true.
json_NodeClone does not have this behavior.
json_MergeObjects
json_Merge
json_NodeClone
The text was updated successfully, but these errors were encountered: