{"action":"created","issue":{"url":"https://api.github.com/repos/spotify/ios-sdk/issues/191","labels_url":"https://api.github.com/repos/spotify/ios-sdk/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/spotify/ios-sdk/issues/191/comments","events_url":"https://api.github.com/repos/spotify/ios-sdk/issues/191/events","html_url":"https://github.com/spotify/ios-sdk/issues/191","id":52370775,"number":191,"title":"Crash in audio streaming when deallocing","user":{"login":"kennylovrin","id":7232,"avatar_url":"https://avatars.githubusercontent.com/u/7232?v=3","gravatar_id":"","url":"https://api.github.com/users/kennylovrin","html_url":"https://github.com/kennylovrin","followers_url":"https://api.github.com/users/kennylovrin/followers","following_url":"https://api.github.com/users/kennylovrin/following{/other_user}","gists_url":"https://api.github.com/users/kennylovrin/gists{/gist_id}","starred_url":"https://api.github.com/users/kennylovrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennylovrin/subscriptions","organizations_url":"https://api.github.com/users/kennylovrin/orgs","repos_url":"https://api.github.com/users/kennylovrin/repos","events_url":"https://api.github.com/users/kennylovrin/events{/privacy}","received_events_url":"https://api.github.com/users/kennylovrin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-18T14:42:17Z","updated_at":"2015-01-07T15:50:52Z","closed_at":null,"body":"I just wanted to verify if this is expected behavior or not as I think I have read somewhere that it is supported to deallocate and allocate new audio controllers, given they are not alive at the same time?\r\n\r\nI have a crash (same problem in two projects) where it seems to crash in a notify callback within SPTAudioStreamingController, and it seems to happen when I deallocate the audio controller.\r\n\r\nI haven't been able to work around it other than keeping a singleton alive. I am however in a situation where I have a very customized core audio controller in one case, and in another case I just need the default behavior. It would great if I could deallocate my custom one and allocate a standard one when I need it, but I can't get it to work.\r\n\r\nJust to clarify, the default one crashes like this wether I have allocated my own before or not, so it happens even without any \"custom\" code ever being allocated if you know what I mean.\r\n\r\nI can't work out much from the error other than this so far in terms of where it crashes (I get a feeling it could perhaps be a delegate thing or something from the c lib that is trying to access something that has been deallocated as it is a bad access crash I think):\r\n`cb_playback_on_notify at SPTAudioStreamingController.m:996\r\n\r\nSo the question is, IS it supported to deallocate and reallocate an SPTAudioStreamingController, and if so, is there a special way I have to deallocate it?"},"comment":{"url":"https://api.github.com/repos/spotify/ios-sdk/issues/comments/69041048","html_url":"https://github.com/spotify/ios-sdk/issues/191#issuecomment-69041048","issue_url":"https://api.github.com/repos/spotify/ios-sdk/issues/191","id":69041048,"user":{"login":"possan","id":33173,"avatar_url":"https://avatars.githubusercontent.com/u/33173?v=3","gravatar_id":"","url":"https://api.github.com/users/possan","html_url":"https://github.com/possan","followers_url":"https://api.github.com/users/possan/followers","following_url":"https://api.github.com/users/possan/following{/other_user}","gists_url":"https://api.github.com/users/possan/gists{/gist_id}","starred_url":"https://api.github.com/users/possan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/possan/subscriptions","organizations_url":"https://api.github.com/users/possan/orgs","repos_url":"https://api.github.com/users/possan/repos","events_url":"https://api.github.com/users/possan/events{/privacy}","received_events_url":"https://api.github.com/users/possan/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T15:50:52Z","updated_at":"2015-01-07T15:50:52Z","body":"It's not really optimal (and quite untested from our side) to have more than one instance of the player running in your app, the best way would be to initialize your player upon start up and keep using that the whole time."}}