From 336b3e6dbaea8964053b92d70e98ac21ed092739 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Fri, 6 Dec 2002 00:37:41 +0000 Subject: [PATCH] Memory leak fixes, from PhracturedBlue git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@352 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/planets/pl_stuff.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/planets/pl_stuff.c b/sc2/src/sc2code/planets/pl_stuff.c index a1a703c27..7aa0935e3 100644 --- a/sc2/src/sc2code/planets/pl_stuff.c +++ b/sc2/src/sc2code/planets/pl_stuff.c @@ -767,16 +767,17 @@ DrawPlanet (int x, int y, int dy, unsigned int rgb) UBYTE r,g,b; DWORD **rgba,p; COUNT i,j,framew; - FRAME tintFrame=pSolarSysState->TintFrame; - if(tintFrame !=0) + FRAME tintFrame; + if(pSolarSysState->TintFrame !=0) { - DestroyDrawable (ReleaseDrawable (tintFrame)); - tintFrame=0; + DestroyDrawable (ReleaseDrawable (pSolarSysState->TintFrame)); + pSolarSysState->TintFrame=0; } framew=GetFrameWidth(s.frame); tintFrame = CaptureDrawable ( CreateDrawable (WANT_PIXMAP, framew, (UWORD)dy, 1) ); + pSolarSysState->TintFrame=tintFrame; rgba=(DWORD **)HMalloc(sizeof(DWORD *)*(dy)); r=(rgb&(0x1f<<10))>>8; g=(rgb&(0x1f<<5))>>3;