Run you project in your debugger. When is asserts look back through the backtrace of the non-main thread(s) until you find the line in your code that is causing the problem.