Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 657
Starbax Avatar asked Nov 07 '11 13:11

Starbax


2 Answers

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.

like image 89
auco Avatar answered Sep 20 '22 19:09

auco


If you have used the following code:

[[NSRunLoop currentRunLoop ] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.0]];

Remove it if not needed, or reduce the time interval. It worked for me.

like image 25
Vishwani Avatar answered Sep 16 '22 19:09

Vishwani