Crash in dialog on iOS 6
billyquith

Getting a crash in _al_show_native_message_box() in native dialog when Allegro 5.1 (git head) compiled against iOS 6. This appears to explain the problem:

http://stackoverflow.com/questions/12468677/exc-bad-access-code-2-on-uialertview-in-ios6

http://sourceforge.net/p/alleg/allegro/ci/9ce3cf3a25d3c7aa20a0869941ef27b917a84398/tree/addons/native_dialog/iphone_dialog.m

I'm guessing this is because when the perform selector is done we are passing an object to the main thread that was allocated on a different thread. I.e. the delegate is passed over, but this refers to the alert, which wasnt allocated on the main thread. Anyone with more experience of Allegro iphone want to comment on this?

Thanks.

----

Ok, this looks to do with TLS. If you pass across the view and the alert view it all seems to work. I think this stopped working with Xcode 4.5 for some reason.

https://github.com/billyquith/allegro5/commit/08c05414253818b30b40fe8f5202c56237fed00d

Patch attached.

Thread #611890. Printed from Allegro.cc