Closed gtanner closed 13 years ago
We ran into this issue while developing the barcode extension and fixed it by closuring the callback IDs see: https://github.com/tneil/MessingAround/commit/ce2c4054580fd43db4c9ab71903e701042d50c6c
Fixed with Pull request #34.
Closed.
Example Case:
What will Happen:
That is not good! The reason for this is the Actionscript code stores the callback IDs in instance variables and trumps them each call.
See: https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.payment/src/Air/Payment/src/blackberry/payment/Payment.as#L33-34
Which is trumped each call here: https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.payment/src/Air/Payment/src/blackberry/payment/Payment.as#L83-84
This problem can be observed in the following APIs:
Dialog
https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.ui.dialog/src/Air/UserInterface/src/blackberry/ui/dialog/Dialog.as#L53
Camera
https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.media.camera/src/Air/Camera/src/blackberry/media/camera/Camera.as#L37-39
Microphone
https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.media.microphone/src/Air/Microphone/src/blackberry/media/microphone/MicrophoneExtension.as#L39-40
Payment
https://github.com/blackberry/WebWorks-TabletOS/blob/master/js_api/blackberry.payment/src/Air/Payment/src/blackberry/payment/Payment.as#L33-34
As a general rule I would expect all of the actionscript code to be stateless and not store anything in instance variables as we need to think of the actionscript as a stateless webserver.