Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Odd behavior on using Delegate method as parameter for callback

$
0
0

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 …


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>