{"action":"created","issue":{"url":"https://api.github.com/repos/opensim-org/opensim-core/issues/528","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/528/comments","events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/528/events","html_url":"https://github.com/opensim-org/opensim-core/issues/528","id":94629163,"number":528,"title":"OpenSim is misusing the SimTK::ReferencePtr class in many places","user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opensim-org/opensim-core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/opensim-org/opensim-core/milestones/1","html_url":"https://github.com/opensim-org/opensim-core/milestones/OpenSim%204.0","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/milestones/1/labels","id":725618,"number":1,"title":"OpenSim 4.0","description":"","creator":{"login":"jenhicks","id":4510959,"avatar_url":"https://avatars.githubusercontent.com/u/4510959?v=3","gravatar_id":"","url":"https://api.github.com/users/jenhicks","html_url":"https://github.com/jenhicks","followers_url":"https://api.github.com/users/jenhicks/followers","following_url":"https://api.github.com/users/jenhicks/following{/other_user}","gists_url":"https://api.github.com/users/jenhicks/gists{/gist_id}","starred_url":"https://api.github.com/users/jenhicks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenhicks/subscriptions","organizations_url":"https://api.github.com/users/jenhicks/orgs","repos_url":"https://api.github.com/users/jenhicks/repos","events_url":"https://api.github.com/users/jenhicks/events{/privacy}","received_events_url":"https://api.github.com/users/jenhicks/received_events","type":"User","site_admin":false},"open_issues":96,"closed_issues":202,"state":"open","created_at":"2014-07-18T21:08:06Z","updated_at":"2015-08-12T23:38:16Z","due_on":null,"closed_at":null},"comments":26,"created_at":"2015-07-13T03:26:09Z","updated_at":"2015-08-14T23:28:33Z","closed_at":null,"body":"`SimTK::ReferencePtr` is a smart pointer that conveys *no* ownership. It is used to point at things owned by someone else. It is better than a raw pointer because it self-initializes to `nullptr` and clear itself back to `nullptr` on copy to avoid dangling references from the copy. The point of it is to allow us to avoid writing copy constructors and copy assignment, as we would have to if we used raw pointers.\r\n\r\nBut since there is no ownership it is *never* OK to invoke `delete` on a `ReferencePtr`! Nor should a `ReferencePtr` ever be set to `new Something()`! There are many instances of both of these errors and they will start producing warnings when PR simbody/simbody#410 is merged. They will have to be fixed very carefully."},"comment":{"url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments/131266872","html_url":"https://github.com/opensim-org/opensim-core/issues/528#issuecomment-131266872","issue_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/528","id":131266872,"user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T23:28:33Z","updated_at":"2015-08-14T23:28:33Z","body":"New mixins `ResetOnCopy<T>` and `ReinitOnCopy<T>` are available now that PR simbody/simbody#426 is merged. Please consider `NullOnCopyUniquePtr` deprecated since `ResetOnCopy<unique_ptr<T>>` does the same thing in a better way and can be used with many other types."}}