Added SocketIOClient.removeAllHandlers

This commit is contained in:
NachoSoto 2015-07-13 00:09:05 +00:00
parent c40b7c169f
commit 5f75e6080b

View File

@ -449,6 +449,14 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
handlers.append(handler) handlers.append(handler)
} }
/**
Removes all handlers.
Can be used after disconnecting to break any potential remaining retain cycles.
*/
public func removeAllHandlers() {
handlers.removeAll(keepCapacity: false)
}
/** /**
Adds a handler that will be called on every event. Adds a handler that will be called on every event.
*/ */