When running valgrind, clicking on start match, then ending the program after frames of the loading screen were rendered, I get this memory leak:
==160587== 24 bytes in 1 blocks are definitely lost in loss record 215 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x30EC8E: RegMemFun<CSimulation2> (LoaderThunks.h:70) ==160587== by 0x30EC8E: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:227) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== by 0x4847809: ??? ==160587== by 0x4C74A5A: EnterBaseline(JSContext*, js::jit::EnterJitData&) (BaselineJIT.cpp:145) ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 216 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3B39AF: RegMemFun<CGameView> (LoaderThunks.h:70) ==160587== by 0x3B39AF: CGameView::RegisterInit() (GameView.cpp:465) ==160587== by 0x30ECC8: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:235) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== by 0x4847809: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 217 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3B3A63: RegMemFun<CTerrainTextureManager> (LoaderThunks.h:70) ==160587== by 0x3B3A63: CGameView::RegisterInit() (GameView.cpp:467) ==160587== by 0x30ECC8: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:235) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== by 0x4847809: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 218 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBCC5: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:0) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 219 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBD2E: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBD2E: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:122) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 220 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBD70: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBD70: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:126) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 221 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBDA9: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBDA9: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:129) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 222 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBDE5: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBDE5: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:132) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 223 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBE1A: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBE1A: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:135) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 224 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBE4F: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBE4F: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:138) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 225 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3BBE84: RegMemFun<CMapReader> (LoaderThunks.h:70) ==160587== by 0x3BBE84: CMapReader::LoadMap(Path const&, JSRuntime*, JS::Handle<JS::Value>, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*, CCinemaManager*, CTriggerManager*, CPostprocManager*, CSimulation2*, CSimContext const*, int, bool) (MapReader.cpp:141) ==160587== by 0x37519C: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:78) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 226 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x3751AA: RegMemFun<CWorld> (LoaderThunks.h:70) ==160587== by 0x3751AA: CWorld::RegisterInit(CStrW const&, JSRuntime*, JS::Handle<JS::Value>, int) (World.cpp:86) ==160587== by 0x30EF3B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:255) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== by 0x4847809: ??? ==160587== ==160587== 24 bytes in 1 blocks are definitely lost in loss record 227 of 3,206 ==160587== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==160587== by 0x30F00B: RegMemFun<WaterManager> (LoaderThunks.h:70) ==160587== by 0x30F00B: CGame::RegisterInit(JS::Handle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:258) ==160587== by 0x30EB3F: CGame::StartGame(JS::MutableHandle<JS::Value>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Game.cpp:373) ==160587== by 0x601CEE: JSI_Game::StartGame(ScriptInterface::CxPrivate*, JS::Handle<JS::Value>, int) (JSInterface_Game.cpp:58) ==160587== by 0x602C18: call<void (ScriptInterface::CxPrivate *, JS::Handle<JS::Value>, int), JS::Handle<JS::Value>, int> (NativeWrapperDefns.h:85) ==160587== by 0x602C18: bool ScriptInterface::call<void, JS::Handle<JS::Value>, int, &JSI_Game::StartGame>(JSContext*, unsigned int, JS::Value*) (NativeWrapperDefns.h:124) ==160587== by 0x50969E7: CallJSNative (jscntxtinlines.h:235) ==160587== by 0x50969E7: js::Invoke(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (Interpreter.cpp:444) ==160587== by 0x50972FB: js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) (Interpreter.cpp:496) ==160587== by 0x4CA0F96: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (BaselineIC.cpp:6162) ==160587== by 0x484F0D9: ??? ==160587== by 0x2E5103E7: ??? ==160587== by 0x4847809: ??? ==160587== by 0x4C74A5A: EnterBaseline(JSContext*, js::jit::EnterJitData&) (BaselineJIT.cpp:145)
refs P178
It seems the param thing is created locally, then received without taking over ownership (i.e. later on deleting).