libretro / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
47 stars 57 forks source link

RetroArch Load Core core triggers a memory leak #140

Closed Dwedit closed 6 years ago

Dwedit commented 6 years ago

I was just trying out Microsoft Application Verifier, and it is reporting a memory leak somewhere. (Looks like some 64K size block isn't getting freed?)

This is in the libretro_get_system_info phase of Load Core, where it loads the core DLL file, queries for file support, then unloads the DLL file.

Snes9x 2010, 2005, and 2002 do not trigger the memory leak upon loading and unloading the DLL.

edit:

Found the leak: (in smp.cpp)

SMP::SMP() {
  apuram = new uint8[64 * 1024];
}

There's no corresponding delete.