Fixed nasty memory leak

This commit is contained in:
pagefault
2001-04-30 03:58:27 +00:00
parent ce1a0014f7
commit 569624f3d8

View File

@@ -821,7 +821,23 @@ BOOL FAR PASCAL InitJoystickInput(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef)
void endgame() void endgame()
{ {
if(lpDirectSound)
{
lpDirectSound->Release();
lpDirectSound=NULL;
}
if(SoundBuffer)
{
SoundBuffer->Release();
SoundBuffer=NULL;
}
if(lpPrimaryBuffer)
{
lpPrimaryBuffer->Release();
lpPrimaryBuffer=NULL;
}
if(DD_CFB) if(DD_CFB)
{ {
@@ -829,14 +845,12 @@ void endgame()
DD_CFB=NULL; DD_CFB=NULL;
} }
if(lpDD) if(lpDD)
{ {
lpDD->Release(); lpDD->Release();
lpDD=NULL; lpDD=NULL;
} }
if(lpDDClipper) if(lpDDClipper)
{ {
lpDDClipper->Release(); lpDDClipper->Release();