vishalduggal/titanium_mobile — comment on commit b2586da67c8afcadc68ed2141615b25624cafc4f
File: iphone/Classes/TiMediaVideoPlayerProxy.m line 495
By BlainHamon:

Guh, I really hate to pick nits here, but you really want to move the assignment of instance variables to between the cancel and the request. Otherwise, we run the risk of race conditions of releasing the callback in the JS thread at the same time invoking it on the main thread, or decrementing the wrong callback request count. By moving the instance variable assignment here, we can avoid threadsafety issues on callbackRequestCount and thumbnailCallback.