appcelerator/titanium_mobile — pull request #2121 by vishalduggal (2012-05-02 20:16:59+00:00)
Title: [TIMOB-8615] Safeguard against race conditions (2_0_X)

Dupe of PR #1977 against 2_0_X

Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-8615)

Need ipod 3rd gen with 4.0.2 to test. Will not reproduce on later OS versions.

The bug seems to be an apple bug where [actionSheet isVisible] always return false (Test device ipod 3rd gen running 4.0.2). So we were releasing the proxy twice. Once on the hide method and then when the user touched the button. Basically the PR safeguards against the release being called twice by checking the showDialog flag in the completeWithButton method