nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

After client and engine close, the threads are still working #117

Open KeChihYang opened 8 years ago

KeChihYang commented 8 years ago

Why I cannot close completely?

private var mClient: SocketIOClient?

init( ... ) { mClient = SocketIOClient(socketURL: NSURL(string: host)!, options: [.Log(true), .ForcePolling(false)]) }

mClient?.removeAllHandlers() mClient?.disconnect() mClient = nil

After closed, my CPU is retaining 8%, and thread is not gone.

nuclearace commented 8 years ago

What thread

KeChihYang commented 8 years ago

I found the root problem. My rootController presented the ViewController contains Socket, and After ViewController dismiss, my thread 1 retains some work causing CPU usage is 8%.

How should I do?