BlueSocket
BlueSocket copied to clipboard
Deinit
When does deinit get called ? I'm using BlueSocket on a Mac running as a server and on a iPhone as a client. The server runs some apple scripts when the client sends some keywords. I noticed that I get memory leaks every time scripts are being executed. I noticed that deinit is never called. Any advice is much appreciated.
Are you using queues? In this case they might be hanging on to the parent object with its reference to your Socket. You will have to signal the queue’s closure to end its listing loop and return so there are no more references owning the Socket object.
See #167 for sort-of the opposite issue I had: the parent object going away and the queue crashing.
I suspect this is due to the fact that the delegate is holding a strong reference:
public var delegate: SSLServiceDelegate? = nil {
I think this should be a weak var
and the SSLServiceDelegate
modified to be a class
protocol.