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 second leak concerns an issue with cscriptarray (version 2.33.0). Basically, I'm finding when I do something like this (result is of type CScriptArray, and AEntity is a custom pass-by-reference that will register with the garbage collector upon construction):
result->InsertLast(new AEntity(engine_ptr, *iter));
When this line is ran, AEntity is inserted as expected, but when the script ends, Valgrind reports the AEntity instances are not cleaned up, but the CScriptArrays are. AEntity instances outside CScriptArrays are cleaned up fine. I'm thinking I'm doing something wrong, but am not sure what. If I just missed something in the documentation, feel free to tell me and I'll go recheck. Does anyone have any ideas what I'm doing wrong? Thanks in advance for the help!