Memory leak fixes, from PhracturedBlue

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@352 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-06 00:37:41 +00:00
parent b570cf1943
commit 336b3e6dba
+5 -4
View File
@@ -767,16 +767,17 @@ DrawPlanet (int x, int y, int dy, unsigned int rgb)
UBYTE r,g,b; UBYTE r,g,b;
DWORD **rgba,p; DWORD **rgba,p;
COUNT i,j,framew; COUNT i,j,framew;
FRAME tintFrame=pSolarSysState->TintFrame; FRAME tintFrame;
if(tintFrame !=0) if(pSolarSysState->TintFrame !=0)
{ {
DestroyDrawable (ReleaseDrawable (tintFrame)); DestroyDrawable (ReleaseDrawable (pSolarSysState->TintFrame));
tintFrame=0; pSolarSysState->TintFrame=0;
} }
framew=GetFrameWidth(s.frame); framew=GetFrameWidth(s.frame);
tintFrame = CaptureDrawable ( tintFrame = CaptureDrawable (
CreateDrawable (WANT_PIXMAP, framew, (UWORD)dy, 1) CreateDrawable (WANT_PIXMAP, framew, (UWORD)dy, 1)
); );
pSolarSysState->TintFrame=tintFrame;
rgba=(DWORD **)HMalloc(sizeof(DWORD *)*(dy)); rgba=(DWORD **)HMalloc(sizeof(DWORD *)*(dy));
r=(rgb&(0x1f<<10))>>8; r=(rgb&(0x1f<<10))>>8;
g=(rgb&(0x1f<<5))>>3; g=(rgb&(0x1f<<5))>>3;