Hello! I'm experiencing a couple of memory leaks and would like to see if anyone knows the correct way to clean them up.
The first leak concerns setting my custom pass-by-reference string class as an argument on the script 'main()' method. I do the usual context SetArgObject() to set the string on the function, ran the script, and did a GarbageCollect() when done. Even when I clean up the context and engine like so:
context_ptr->Abort();
context_ptr->Unprepare();
engine_ptr->DiscardModule(SCRIPT_MODULE_NAME.c_str());
engine_ptr->GarbageCollect();
engine_ptr->ReturnContext(context_ptr);
engine_ptr->ShutDownAndRelease();
The string argument is never cleaned up and Valgrind finds it. The other string instances are cleaned up fine. Am I supposed to always manually delete the argument once execution has completed? The string class automatically registers with the engine's garbage collector, so I figured that would do it, but it doesn't seem to work. It's also quite possible I'm doing something wrong, so any ideas are appreciated! Thanks in advance for your help!