clickedButtonAtIndex callblack is dispatched to avoid application crashes

This commit is contained in:
Yannick Le Collen 2014-12-17 09:20:18 +01:00
parent 8d8c5dcabd
commit 38156c0873

View file

@ -1,3 +1,4 @@
/*
Copyright 2014 OpenMarket Ltd
@ -188,7 +189,9 @@
blockCustomAlert_onClick block = [actions objectAtIndex:buttonIndex];
if ([block isEqual:[NSNull null]] == NO) {
// And call it
block(self);
dispatch_async(dispatch_get_main_queue(), ^{
block(self);
});
}
// Release alert reference
_alert = nil;
@ -201,7 +204,9 @@
blockCustomAlert_onClick block = [actions objectAtIndex:buttonIndex];
if ([block isEqual:[NSNull null]] == NO) {
// And call it
block(self);
dispatch_async(dispatch_get_main_queue(), ^{
block(self);
});
}
// Release _alert reference
_alert = nil;