diff --git a/sc2/src/sc2code/planets/pl_stuff.c b/sc2/src/sc2code/planets/pl_stuff.c index e06336690..01c760218 100644 --- a/sc2/src/sc2code/planets/pl_stuff.c +++ b/sc2/src/sc2code/planets/pl_stuff.c @@ -532,6 +532,7 @@ RotatePlanet (int x, int da, int dx, int dy, int zoom) COUNT frameh,this_scale; if(pSolarSysState->ScaleFrame[i]) { DestroyDrawable (ReleaseDrawable (pSolarSysState->ScaleFrame[i])); + pSolarSysState->ScaleFrame[i]=0; } frameh=GetFrameHeight(pFrame[i]); this_scale=frameh*scale_amt/MAP_HEIGHT; diff --git a/sc2/src/sc2code/planets/planets.c b/sc2/src/sc2code/planets/planets.c index a8afd41ca..2cc7a8c63 100644 --- a/sc2/src/sc2code/planets/planets.c +++ b/sc2/src/sc2code/planets/planets.c @@ -216,6 +216,8 @@ FreePlanet (void) for(i=0;i<255;i++) { DestroyDrawable (ReleaseDrawable (pSolarSysState->PlanetFrameArray[i])); } + free(pSolarSysState->PlanetFrameArray); + free(pSolarSysState->isPFADefined); for(i=0;i<2;i++) { if(pSolarSysState->ScaleFrame[i]) { DestroyDrawable (ReleaseDrawable (pSolarSysState->ScaleFrame[i])); @@ -226,14 +228,13 @@ FreePlanet (void) DestroyDrawable (ReleaseDrawable (pSolarSysState->ShieldFrame)); pSolarSysState->ShieldFrame=0; } - if(pSolarSysState->lpTopoMap!=NULL) { + if(pSolarSysState->lpTopoMap!=0) { for(i=0;pSolarSysState->lpTopoMap[i]!=NULL;i++) { free(pSolarSysState->lpTopoMap[i]); } free(pSolarSysState->lpTopoMap); + pSolarSysState->lpTopoMap=0; } - free(pSolarSysState->PlanetFrameArray); - free(pSolarSysState->isPFADefined); DestroyContext (ReleaseContext (TaskContext)); TaskContext = 0;