From db2d8cd884105b68456cacdd78a7906879bc1fc9 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Mon, 21 May 2001 17:13:46 +0000 Subject: [PATCH] Hopefully fixed exit bug on some computers --- zsnes/src/win/winlink.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index e7d5290b..66d559f0 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -1083,15 +1083,18 @@ startgame() { return FALSE; } - if (FAILED(lpDD->CreateClipper(0,&lpDDClipper,NULL))) { + lpDD->Release(); + lpDD=NULL; return FALSE; } if (FAILED(lpDDClipper->SetHWnd(0,hMainWindow))) { + lpDD->Release(); + lpDD=NULL; return FALSE; } @@ -1115,7 +1118,7 @@ startgame() exit(0); } - if(BitDepth==16&& GBitMask!=0x07E0) + if(BitDepth==16 && GBitMask!=0x07E0) { converta=1; } @@ -1137,6 +1140,7 @@ startgame() if ( lpDD->CreateSurface( &ddsd, &DD_CFB, NULL ) != DD_OK ) { + DD_CFB->Release(); DD_CFB = NULL; return FALSE; } @@ -1145,7 +1149,7 @@ startgame() } BYTE* SurfBuf; -DDSURFACEDESC ddsd; +DDSURFACEDESC ddsd; DWORD LockSurface() {