You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed some crashes in our app which appears to be happening when a SuperpoweredIosAudio reacted to a notification and then dereferenced a null pointer. Upon further investigation, it seemed that the object was not being destroyed when we expected it to be because the stopTimer object maintained a strong reference to it and would prevent destruction by our wrapper which owned the Superpowered object --> in other words, it is a retain cycle.
It appears that when using manual release counting, this is accounted for in the code -- but when using ARC, seemingly not.
Thanks for pointing this out. We will look into it - although this is in the open source part of the library, so if you feel like it, don't hesitate to open a PR with the fix!
We noticed some crashes in our app which appears to be happening when a SuperpoweredIosAudio reacted to a notification and then dereferenced a null pointer. Upon further investigation, it seemed that the object was not being destroyed when we expected it to be because the stopTimer object maintained a strong reference to it and would prevent destruction by our wrapper which owned the Superpowered object --> in other words, it is a retain cycle.
It appears that when using manual release counting, this is accounted for in the code -- but when using ARC, seemingly not.
This can be prevented in many ways, for example by using a weak pointer. You can find further details in this StackOverflow post: https://stackoverflow.com/questions/40358646/invalidating-an-nstimer-in-dealloc
In our case, as we don't need the timer we cannot init it at all, and we can see that the object is destroyed when we expect it to be.
PS It was fun hanging out with you guys at ADC!
The text was updated successfully, but these errors were encountered: