vert-x3 / vertx-proton

Apache License 2.0
26 stars 26 forks source link

Memory leak when connect attempt fails. #51

Closed sophokles73 closed 7 years ago

sophokles73 commented 7 years ago

ProtonClientImpl.connectNetClient() currently does not close the NetClient being passed in as a param from the connect() methods, if the connect attempt fails.

When the NetClient instance is created, the NetClientImpl constructor registers a closeHook for it in the vert.x Context. This hook is removed when NetClientImpl.close() is invoked. However, when a connect attempt fails, this method is never invoked and thus the hook is never removed, preventing the (useless) NetClientImpl instance from being garbage collected.

gemmellr commented 7 years ago

Marked as duplicate to avoid double release notes addition.