{"action":"created","issue":{"url":"https://api.github.com/repos/jamoma/JamomaCore/issues/353","labels_url":"https://api.github.com/repos/jamoma/JamomaCore/issues/353/labels{/name}","comments_url":"https://api.github.com/repos/jamoma/JamomaCore/issues/353/comments","events_url":"https://api.github.com/repos/jamoma/JamomaCore/issues/353/events","html_url":"https://github.com/jamoma/JamomaCore/issues/353","id":60126751,"number":353,"title":"Address weakness in notification/observer system","user":{"login":"tap","id":109637,"avatar_url":"https://avatars.githubusercontent.com/u/109637?v=3","gravatar_id":"","url":"https://api.github.com/users/tap","html_url":"https://github.com/tap","followers_url":"https://api.github.com/users/tap/followers","following_url":"https://api.github.com/users/tap/following{/other_user}","gists_url":"https://api.github.com/users/tap/gists{/gist_id}","starred_url":"https://api.github.com/users/tap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tap/subscriptions","organizations_url":"https://api.github.com/users/tap/orgs","repos_url":"https://api.github.com/users/tap/repos","events_url":"https://api.github.com/users/tap/events{/privacy}","received_events_url":"https://api.github.com/users/tap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jamoma/JamomaCore/labels/priority/high","name":"priority/high","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"tap","id":109637,"avatar_url":"https://avatars.githubusercontent.com/u/109637?v=3","gravatar_id":"","url":"https://api.github.com/users/tap","html_url":"https://github.com/tap","followers_url":"https://api.github.com/users/tap/followers","following_url":"https://api.github.com/users/tap/following{/other_user}","gists_url":"https://api.github.com/users/tap/gists{/gist_id}","starred_url":"https://api.github.com/users/tap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tap/subscriptions","organizations_url":"https://api.github.com/users/tap/orgs","repos_url":"https://api.github.com/users/tap/repos","events_url":"https://api.github.com/users/tap/events{/privacy}","received_events_url":"https://api.github.com/users/tap/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jamoma/JamomaCore/milestones/15","html_url":"https://github.com/jamoma/JamomaCore/milestones/Foundation%20Code%20Review","labels_url":"https://api.github.com/repos/jamoma/JamomaCore/milestones/15/labels","id":1001786,"number":15,"title":"Foundation Code Review","description":"Careful review of implementation, design, tests, and practices in JamomaFoundation.\r\nParticular emphasis to be given to safe and idiomatic C++11/C++14 code.","creator":{"login":"tap","id":109637,"avatar_url":"https://avatars.githubusercontent.com/u/109637?v=3","gravatar_id":"","url":"https://api.github.com/users/tap","html_url":"https://github.com/tap","followers_url":"https://api.github.com/users/tap/followers","following_url":"https://api.github.com/users/tap/following{/other_user}","gists_url":"https://api.github.com/users/tap/gists{/gist_id}","starred_url":"https://api.github.com/users/tap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tap/subscriptions","organizations_url":"https://api.github.com/users/tap/orgs","repos_url":"https://api.github.com/users/tap/repos","events_url":"https://api.github.com/users/tap/events{/privacy}","received_events_url":"https://api.github.com/users/tap/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":0,"state":"open","created_at":"2015-03-02T13:07:12Z","updated_at":"2015-03-23T11:56:17Z","due_on":"2015-05-01T05:00:00Z","closed_at":null},"comments":2,"created_at":"2015-03-06T16:45:21Z","updated_at":"2015-03-24T13:48:37Z","closed_at":null,"body":"Over the years both @theod and I have been bitten some really difficult to track bugs stemming from pointers going out of scope or leaking in the observer and notification system.  This is still at the heart of our worst AudioGraph problems that we need to solve.\r\n\r\nI have two insights that together could revolutionize our system:\r\n\r\n1. From C++11 smart pointers -- Objects being observed are all shared pointers.  The objects that issue notifications can track them using weak pointers, which know when the underlying object goes away!\r\n\r\n2. RAII -- An observer (let's call it TTObserver, assuming that name isn't taken) should be a class of it's own.  An object which wishes to observe another object should create an instance of TTObserver.  Then when it goes out of scope everything cleans up after itself neatly, unlike the wild west manual cleanup that happens currently (and problematically in some cases).\r\n\r\nThis implies that TTObject ref counting and other \"smart pointer\" stuff which we have implemented manually migrate to standard C++ smart pointers."},"comment":{"url":"https://api.github.com/repos/jamoma/JamomaCore/issues/comments/85502530","html_url":"https://github.com/jamoma/JamomaCore/issues/353#issuecomment-85502530","issue_url":"https://api.github.com/repos/jamoma/JamomaCore/issues/353","id":85502530,"user":{"login":"theod","id":118426,"avatar_url":"https://avatars.githubusercontent.com/u/118426?v=3","gravatar_id":"","url":"https://api.github.com/users/theod","html_url":"https://github.com/theod","followers_url":"https://api.github.com/users/theod/followers","following_url":"https://api.github.com/users/theod/following{/other_user}","gists_url":"https://api.github.com/users/theod/gists{/gist_id}","starred_url":"https://api.github.com/users/theod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theod/subscriptions","organizations_url":"https://api.github.com/users/theod/orgs","repos_url":"https://api.github.com/users/theod/repos","events_url":"https://api.github.com/users/theod/events{/privacy}","received_events_url":"https://api.github.com/users/theod/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T13:48:37Z","updated_at":"2015-03-24T13:48:37Z","body":"I also mention that for the time being if I change an attribute I have to take care to notify its observers (which is normal but a bit convoluted : see [here](https://github.com/jamoma/JamomaCore/blob/master/Modular/library/PeerObject/TTData.cpp) in TTData::notifyObservers))."}}