iOS app crashes when going to background if a NetStream is referenced.
Hello there,
this has ben testedby several people on several versions of AIR.
Source code here: https://tracker.adobe.com/api/jira/issue/AIR-4198784/attachment/3439791
On iOS, if a netstream is referenced to a variable, once the app goes to background, then crashes when brought to foreground again. It seems like a null pointer exception on iOS side. Apple console shows a null reference exception.
Just a few lines are enough to cause the bug:
- private var _ns:NetStream; // This is in class constructor
- var nc:NetConnection = new NetConnection();
- nc.connect(null);
- var ns:NetStream = new NetStream(nc);
- /* THIS IS THE CULPRIT. COMMENT "_ns = ns" AND APP WILL NOT CRASH */
- _ns = ns; // If this is commented, app doesn't crash.
Just bring the app to background, then foreground again, and on iOS it will crash (all works fine on other platforms).
Cheers
