{"action":"created","issue":{"url":"https://api.github.com/repos/akheron/jansson/issues/230","labels_url":"https://api.github.com/repos/akheron/jansson/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/akheron/jansson/issues/230/comments","events_url":"https://api.github.com/repos/akheron/jansson/issues/230/events","html_url":"https://github.com/akheron/jansson/issues/230","id":71154464,"number":230,"title":"feature request: Safe removal in json_object_foreach","user":{"login":"snskshn","id":1332526,"avatar_url":"https://avatars.githubusercontent.com/u/1332526?v=3","gravatar_id":"","url":"https://api.github.com/users/snskshn","html_url":"https://github.com/snskshn","followers_url":"https://api.github.com/users/snskshn/followers","following_url":"https://api.github.com/users/snskshn/following{/other_user}","gists_url":"https://api.github.com/users/snskshn/gists{/gist_id}","starred_url":"https://api.github.com/users/snskshn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snskshn/subscriptions","organizations_url":"https://api.github.com/users/snskshn/orgs","repos_url":"https://api.github.com/users/snskshn/repos","events_url":"https://api.github.com/users/snskshn/events{/privacy}","received_events_url":"https://api.github.com/users/snskshn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-27T02:19:38Z","updated_at":"2015-08-26T14:34:37Z","closed_at":"2015-08-26T14:33:18Z","body":"I want to iterate over an object and delete some elements in it. If I use both json_object_foreach and json_object_del(assume that object contains only other objects), segmentation fault occurs in multi-threading environment because freed \"key\" pointer is used for finding next key.\r\n\r\nIn kernel's linked-list implementation, there is not only list_for_each_entry() but also list_for_each_entry_safe() for safe removal of entries in a for loop. I felt json_object_foreach as a safe one because there's no safe version of that. If Jansson provides this kind of feature, it would be great! "},"comment":{"url":"https://api.github.com/repos/akheron/jansson/issues/comments/135042067","html_url":"https://github.com/akheron/jansson/issues/230#issuecomment-135042067","issue_url":"https://api.github.com/repos/akheron/jansson/issues/230","id":135042067,"user":{"login":"akheron","id":70927,"avatar_url":"https://avatars.githubusercontent.com/u/70927?v=3","gravatar_id":"","url":"https://api.github.com/users/akheron","html_url":"https://github.com/akheron","followers_url":"https://api.github.com/users/akheron/followers","following_url":"https://api.github.com/users/akheron/following{/other_user}","gists_url":"https://api.github.com/users/akheron/gists{/gist_id}","starred_url":"https://api.github.com/users/akheron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akheron/subscriptions","organizations_url":"https://api.github.com/users/akheron/orgs","repos_url":"https://api.github.com/users/akheron/repos","events_url":"https://api.github.com/users/akheron/events{/privacy}","received_events_url":"https://api.github.com/users/akheron/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T14:34:37Z","updated_at":"2015-08-26T14:34:37Z","body":"Added ``json_object_foreach_safe``, see also https://jansson.readthedocs.org/en/latest/apiref.html#c.json_object_foreach_safe"}}