I have a background thread that uses CGBitmapContextCreate
to do some drawing to a memory buffer. I believe this is causing random EXEC_BAD_ACCESS exceptions. Keyword is random.
I believe it may be my lack of understanding of CG thread safety. That is a guess, but I've checked quite thoroughly via line by line debug outputs and the bug shows in random areas for the most part.
Also, I believe it has to do with a UITableView
that I refresh while the thread is still doing its thing. I have added a delay on my reloadData
calls in the hopes that htis might help, but it feels like it only reduces the bug, not solve it.
Could anyone explain to me how I might find out the source of this bug so I can fix it?
Thanks.