I’ve read that objects created in the chaiscript will be destroyed when the Chaiscript object is destroyed in C++ code. What I find is when I use the Chaiscript in std::async task, the objects created in the script are destroyed as soon as thread exits.
Is this an expected behavior ? I was expecting that the objects should stay valid until the Chaiscript object is destroyed. If this is the case then I would have to managed the object in the application code instead.