zwopple / PocketSocket

Objective-C websocket library for building things that work in realtime on iOS and OS X.
Other
414 stars 129 forks source link

Run loop crash on attempted socket server close #18

Closed paulshapiro closed 9 years ago

paulshapiro commented 10 years ago

Hi there,

Another gentleman posted about a runloop crash on an attempt to close a socket. He closed his ticket, even though there was no answer there. But I'm encountering the same issue. I've tried a bunch of stuff, but I had no luck. Any guidance would be greatly appreciated.

Thanks very much for the work on this library. I'm using it for something awesome. Paul

robertjpayne commented 10 years ago

Hi Paul, are you using the latest version? It should be resolved now as I had updated a few cases where it could crash.

paulshapiro commented 10 years ago

Hi, thanks for taking the time to help out! I downloaded and used the zip of master. Finder says everything was last modified on August 11, 2014. Does that give you enough info?

paulshapiro commented 10 years ago

@robertjpayne hey Robert, just following up on this. Haven't had any luck averting the crash. I think I'm using the latest version, but not sure how to confirm.

piloChambert commented 10 years ago

Hi! I had the same crash, I made a quick fix to it (but it should lead to a leak somewhere) by simply removing the release on the CFRunLoopRef : line 222 of PSWebSocketServer.m just comment the line CFRelease(runLoop);

It's a dirty fix I think, I don't understand why there's a CFRelease there, I'll investigate it later.

robertjpayne commented 10 years ago

Hey all, I'm probably going to need to wait until the weekend to address this, super crazy busy week. I put the CFRelease in there because it seems naughty not to. The run loop should never really exit anyways so I'll try and sort out why it is.

robertjpayne commented 10 years ago

@PLCGame your fix was actually correct,I incorrectly assumed getCFRunLoop was returning a retained object but looking at the headers it's not thus the CFRelease would cause an automatic crash.

I've pushed fixes to master but want to test out a bit more before I push to trunk!

ghost commented 9 years ago

Any chance of this fix making it into the latest version pulled by CocoaPods? I'm also hitting this crash (on PocketSocket 0.6.3) and commenting out the line mentioned above does seem to fix it for me. While I don't mind working around it for now, modifying CocoaPod dependencies locally is asking for trouble down the road. :)

ghost commented 9 years ago

Any word on when this fix might make it into a CocoaPods release? Even a marked beta release would be great for my needs.

robertjpayne commented 9 years ago

Hey all, sorry for the delay on this, it's pushed to CocoaPods now!

ghost commented 9 years ago

Great, thanks!