Open KeChihYang opened 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.
What thread
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?
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.