Multiple locks on web thread not allowed! Please file a bug. Crashing now

Starbax picture Starbax · Nov 7, 2011 · Viewed 9.5k times · Source

i make a url-Request and waiting for the answer with

I start the request, then waiting until synchronousOperationComplete=TRUE

NSRunLoop *theRL = [NSRunLoop currentRunLoop];

while (!synchronousOperationComplete && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);

then I return the response

all seems to be ok,i get the response and everything is working normal, but when I close the app i get:

bool _WebTryThreadLock(bool), 0x227f40: Multiple locks on web thread not allowed! Please file a bug. Crashing now...

1   _ZL17_WebTryThreadLockb
2   _ZL14WebRunLoopLockP19__CFRunLoopObservermPv
3   __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
4   __CFRunLoopDoObservers
5   __CFRunLoopRun
6   CFRunLoopRunSpecific
7   CFRunLoopRunInMode
8   _ZL12RunWebThreadPv
9   _pthread_start
10  thread_start

it seems to be the NSRunLoop what causes the error, when I commend it out the error doesn't appear.

I use IOS 5.0 does someone have a clue what I can do to avoid this error?

i used this in IOS 4.3 and IOS5 Beta and it works fine.

but i moved my tomcat6 to an other server, maybe it is an error of the server

THX mBax

Answer

auco picture auco · May 19, 2012

I just had the same error message, but I tried to call a stringByEvaluatingJavaScript on a webView that wasn't on screen.

In general this message hints that something is trying to access an item (UIWebView) while the particular thread of this item is locked.