On May 1, 2012, at 12:30 PM, Motti Shneor wrote:

> To avoid the crash, we tried to defer the "endSheet" via 
> "performSelecor:@selector(closeAnyOpenSheet) afterDelay:0.0". This prevents 
> the releasing of the dialog before the "mouseUp" event is received. However, 
> when  "mouseUp" event comes, the didEndSelector is called for the sheet-alert 
> (before our deferred "endSheet" has a chance to happen), and then we face 
> another problem --- we try to accomplish user command, in a dead context.

There are always going to be race conditions like this — the user can always 
press a button at exactly the same time something asynchronously makes the 
button meaningless. Your code just has to deal with it safely. Presumably 
something underneath will return a kSessionClosedError, and the UI code will 
just ignore it because the sheet’s gone already.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to