rem: SetSemaphore (GraphicsSem);
context: FreePlanet (void){	COUNT i;	SetSemaphore (GraphicsSem);	if (pSolarSysState->MenuState.flash_task)	{		Task_SetState (pSolarSysState->MenuState.flash_task, TASK_EXIT);		pSolarSysState->MenuState.flash_task = 0;	}	StopMusic ();	for (i = 0; i < sizeof (pSolarSysState->PlanetSideFrame)			/ sizeof (pSolarSysState->PlanetSideFrame[0]); ++i)	{		DestroyDrawable (ReleaseDrawable (pSolarSysState->PlanetSideFrame[i]));		pSolarSysState->PlanetSideFrame[i] = 0;	}//    FreeLanderData ();	DestroyStringTable (ReleaseStringTable (pSolarSysState->XlatRef));	pSolarSysState->XlatRef = 0;	UnlockResourceData (pSolarSysState->hTopoData);	FreeResourceData (pSolarSysState->hTopoData);	pSolarSysState->hTopoData = 0;	DestroyDrawable (ReleaseDrawable (pSolarSysState->TopoFrame));	pSolarSysState->TopoFrame = 0;	DestroyColorMap (ReleaseColorMap (pSolarSysState->OrbitalCMap));	pSolarSysState->OrbitalCMap = 0;	for (i=0; i<255; i++)		DestroyDrawable (ReleaseDrawable (pSolarSysState->PlanetFrameArray[i]));	HFree (pSolarSysState->PlanetFrameArray);	pSolarSysState->PlanetFrameArray = 0;	HFree (pSolarSysState->isPFADefined);	pSolarSysState->isPFADefined = 0;	for (i = 0; i < 2; i++)		if (pSolarSysState->ScaleFrame[i]) 		{			DestroyDrawable (ReleaseDrawable (pSolarSysState->ScaleFrame[i]));			pSolarSysState->ScaleFrame[i]=0;		}	if(pSolarSysState->ShieldFrame != 0)	{		DestroyDrawable (ReleaseDrawable (pSolarSysState->ShieldFrame));		pSolarSysState->ShieldFrame = 0;	}	if (pSolarSysState->TintFrame != 0)	{		DestroyDrawable (ReleaseDrawable (pSolarSysState->TintFrame));		pSolarSysState->TintFrame = 0;	}	if (pSolarSysState->lpTopoMap!=0)	{		for (i=0; pSolarSysState->lpTopoMap[i] != NULL; i++)			HFree (pSolarSysState->lpTopoMap[i]);		HFree (pSolarSysState->lpTopoMap);		pSolarSysState->lpTopoMap = 0;	}	DestroyContext (ReleaseContext (TaskContext));	TaskContext = 0;	DestroyStringTable (ReleaseStringTable (			pSolarSysState->SysInfo.PlanetInfo.DiscoveryString			));	pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0;	DestroyFont (ReleaseFont (			pSolarSysState->SysInfo.PlanetInfo.LanderFont			));	pSolarSysState->SysInfo.PlanetInfo.LanderFont = 0;	ClearSemaphore (GraphicsSem);}