Fixed nasty memory leak
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user