naptics / PlainPing

a very plain ping interface in swift
MIT License
60 stars 21 forks source link

didReceiveUnexpectedPacket causing memory leaks #27

Closed nneuberger1 closed 4 years ago

nneuberger1 commented 4 years ago

We identified that the commented out code in this PR was causing memory leaks. If you look at the call stack after that, the second delegate isn't calling back to clean up the objects created. For now, we just commented out the code and allow the Timer to be hit and thus calling the delegate to cleanly drop out. I wasn't sure what the need for this didReceiveUnexpectedPacket is there to detect. I would be fine with keeping it, but it's not calling the delegate and cleaning up objects.