-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix issues with json-c v0.13 (Fixes #1355) #1517
Conversation
sway/ipc-server.c
Outdated
// to another json_object, it must be done with a wrapped call to | ||
// json_object_get(). Otherwise the object's refcount does not | ||
// get properly incremented and it will be deleted together with | ||
// the object it got added to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment belongs in the commit message
I hate that we have to do this terrible workaround, but I don't see a better way. This sucks. |
@SirCmpwn This is actually NOT a workaround, but well documented behaviour of json_object_object_add() in the json-c API… See: https://github.com/json-c/json-c/blob/master/json_object.h#L379
and: https://github.com/json-c/json-c/blob/master/json_object.h#L408
|
I'm referring to the typedef and the version check header, not the refcounting. |
When adding a referenced json_object with an unknown lifetime to another json_object, it must be done with a wrapped call to json_object_get() to acquire the ownership of that json_object.
3097858
to
02da9c4
Compare
Ahh, I see… Well, the typedef is not needed, if we remove |
Nah, I prefer this to dropping Werror, since Werror is useful beyond this one json-c problem. |
This has been merged into the 0.15 branch and will make the next bugfix release. Thanks! |
@SirCmpwn What about the master-branch? |
Don't worry about it. |
This superseeds #1439 and fixes #1355.