{"comment":{"url":"https://api.github.com/repos/open-source-parsers/jsoncpp/comments/18291507","html_url":"https://github.com/open-source-parsers/jsoncpp/commit/0f288aecdd158cb13e16a5f76537b44df32a7d8e#commitcomment-18291507","id":18291507,"user":{"login":"marklakata","id":5741616,"avatar_url":"https://avatars.githubusercontent.com/u/5741616?v=3","gravatar_id":"","url":"https://api.github.com/users/marklakata","html_url":"https://github.com/marklakata","followers_url":"https://api.github.com/users/marklakata/followers","following_url":"https://api.github.com/users/marklakata/following{/other_user}","gists_url":"https://api.github.com/users/marklakata/gists{/gist_id}","starred_url":"https://api.github.com/users/marklakata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marklakata/subscriptions","organizations_url":"https://api.github.com/users/marklakata/orgs","repos_url":"https://api.github.com/users/marklakata/repos","events_url":"https://api.github.com/users/marklakata/events{/privacy}","received_events_url":"https://api.github.com/users/marklakata/received_events","type":"User","site_admin":false},"position":16,"line":42,"path":"src/lib_json/json_value.cpp","commit_id":"0f288aecdd158cb13e16a5f76537b44df32a7d8e","created_at":"2016-07-18T23:51:08Z","updated_at":"2016-07-18T23:51:08Z","body":"I think I will weigh in here and say that `static value const nullStatic;` method is preferable. The argument for use a pointer and `new` is only for the destructor -- but I believe that the Json::Value destructor doesn't do anything in this case. It will just leave the memory as zeros, and the symbol will stay put. So even if some other global destructor decides to reference the nullStatic, it will still see a well defined symbol and zeros at the corresponding memory.  The `new` method does cause a memory leak.  Programs like valgrind and VS will complain. \r\n\r\nThe nullStatic symbol is permanently bound at the static memory location at link time and nothing will overwrite it. If it were on the heap then I would be nervous, but it is not on the heap. The memory remains there, untouched, until the program terminates.  "}}
{"actor":{"display_login":"marklakata"}}