socket.io-client-swift
socket.io-client-swift copied to clipboard
Pointer being freed was not allocated | Random Crash
A very infrequent crash is coming in my project with the following exception:
malloc: *** error for object 0x7f9c6391b800: pointer being freed was not allocated
(34527,0x700001505000) malloc: *** set a breakpoint in malloc_error_break to debug
Following is my code snippet to emit an event:
private func emitWithACK(withTimeoutAfter seconds: Double, event: String, params : JSONDictionary?, array:[Any]?, ackHandler: (([Any]) -> Void)? = nil) {
var ack : OnAckCallback? = nil
if let tempParams = params {
ack = self.socket?.emitWithAck(event, tempParams)
} else if let tempArray = array{
ack = self.socket?.emitWithAck(event, tempArray)
} else {
ack = self.socket?.emitWithAck(event)
}
ack?.timingOut(after: seconds, callback: { (data) in
ackHandler?(data)
})
}
@banjun @rauchg @bazza @mdawaffe Hey guyz, Can anyone help. a lot of users are affected because of this crash.