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.
ProtonClientImpl.connectNetClient()
currently does not close theNetClient
being passed in as a param from theconnect()
methods, if the connect attempt fails.When the
NetClient
instance is created, theNetClientImpl
constructor registers a closeHook for it in the vert.xContext
. This hook is removed whenNetClientImpl.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.