I'm exposing a C++ Class to AS (WebsocketClient), and it should to be destroyed as the class instantiating it is destroyed.
When the C++ Class is destroyed, it's destructor runs Disconnect() method.
So, for the callbacks functions I'm breaking up as the Delegates example on https://www.angelcode.com/angelscript/sdk/docs/manual/doc_callbacks.html.
The odd behavior:
After some fix suggested on other discussion, It almost works as expected, I could pass a delegate for callback, and when destroyed, WebsocketClient destructor and Disconnect() are called, unless the method used for callback is defined in the same …