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()
{
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();