I played debugger with profiler and found some memory leak:
1) ActorPrototype_BaseProjectileSpawner and ActorPrototype_Level2_CannonBall has multi definitions. I removed unnecessary xml assets. It produced memory leaks.
2) OpenClaw/CMakeLists.txt has comment. Uncomment it to print heap dump with Visual Studio CRT. It shows source code references to investigate memory leaks.
3) Actors cannot be freed. they have cached PositionComponent. And PositionComponent has an owner. Now it fixed.
4) Fixed big part of leaks with Animation class.
5) Refactored BaseGameApp and ResourceMgr classes. Now BaseGameApp and ResourceMgr frees all resources. Also refactored main loop executor in BaseGameApp class. Game didn't call exit(0) anymore.
6) Fixed some TinyXML resources leaks.
Now heap dumper shows memory leak ~ 40 byte (It's something with EventData_Quit_Game shared pointer). I think it's a win.
I played debugger with profiler and found some memory leak: 1)
ActorPrototype_BaseProjectileSpawner
andActorPrototype_Level2_CannonBall
has multi definitions. I removed unnecessary xml assets. It produced memory leaks. 2)OpenClaw/CMakeLists.txt
has comment. Uncomment it to print heap dump with Visual Studio CRT. It shows source code references to investigate memory leaks. 3) Actors cannot be freed. they have cachedPositionComponent
. AndPositionComponent
has an owner. Now it fixed. 4) Fixed big part of leaks withAnimation
class. 5) RefactoredBaseGameApp
andResourceMgr
classes. NowBaseGameApp
andResourceMgr
frees all resources. Also refactored main loop executor inBaseGameApp
class. Game didn't callexit(0)
anymore. 6) Fixed some TinyXML resources leaks.Now heap dumper shows memory leak ~ 40 byte (It's something with
EventData_Quit_Game
shared pointer). I think it's a win.