psx - properly dispose resources used by core

This commit is contained in:
zeromus 2015-07-13 16:07:34 -05:00
parent 451fd779bc
commit 641b67e1cc
1 changed files with 10 additions and 4 deletions

View File

@ -122,13 +122,19 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
{
if (disposed) return;
disposed = true;
//discs arent bound to shock core instances, but they may be mounted. kill the core instance first to effectively dereference the disc
OctoshockDll.shock_Destroy(psx);
psx = IntPtr.Zero;
disposed = true;
//TODO - dispose disc wrappers
//TODO - dispose discs
//destroy all discs we're managing (and the unmanaged octoshock resources)
foreach (var di in discInterfaces)
{
di.Disc.Dispose();
di.Dispose();
}
discInterfaces.Clear();
}
/// <summary>