From 569624f3d8bb0e42d27d46ad8132e9027df19085 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Mon, 30 Apr 2001 03:58:27 +0000 Subject: [PATCH] Fixed nasty memory leak --- zsnes/src/win/winlink.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index fdb2d53a..aa869ee1 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -821,7 +821,23 @@ BOOL FAR PASCAL InitJoystickInput(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) void endgame() { + if(lpDirectSound) + { + lpDirectSound->Release(); + lpDirectSound=NULL; + } + if(SoundBuffer) + { + SoundBuffer->Release(); + SoundBuffer=NULL; + } + + if(lpPrimaryBuffer) + { + lpPrimaryBuffer->Release(); + lpPrimaryBuffer=NULL; + } if(DD_CFB) { @@ -829,14 +845,12 @@ void endgame() DD_CFB=NULL; } - if(lpDD) { lpDD->Release(); lpDD=NULL; } - if(lpDDClipper) { lpDDClipper->Release();