StarSystem::~StarSystem()
{
    if ( _Universe->getNumActiveStarSystem() )
        _Universe->activeStarSystem()->SwapOut();
    _Universe->pushActiveStarSystem( this );
    ClientServerSetLightContext( lightcontext );
    delete[] name;
    Unit *unit;
    for (un_iter iter = drawList.createIterator(); (unit = *iter); ++iter)
        unit->Kill( false );
    //if the next line goes ANYWHERE else Vega Strike will CRASH!!!!!
    //DO NOT MOVE THIS LINE! IT MUST STAY
    if (collidetable) delete collidetable;
    _Universe->popActiveStarSystem();
    vector< StarSystem* >activ;
    while ( _Universe->getNumActiveStarSystem() ) {
        if (_Universe->activeStarSystem() != this)
            activ.push_back( _Universe->activeStarSystem() );
        else
            fprintf( stderr, "Avoided fatal error in deleting star system %s\n", getFileName().c_str() );
        _Universe->popActiveStarSystem();
    }
    while ( activ.size() ) {
        _Universe->pushActiveStarSystem( activ.back() );
        activ.pop_back();
    }
    if ( _Universe->getNumActiveStarSystem() )
        _Universe->activeStarSystem()->SwapIn();
    RemoveStarsystemFromUniverse();
    delete collidemap[Unit::UNIT_ONLY];
    delete collidemap[Unit::UNIT_BOLT];
}
GameStarSystem::~GameStarSystem()
{
	_Universe->pushActiveStarSystem(this);
#ifdef NV_CUBE_MAP

	delete LightMap[0];
	delete LightMap[1];
	delete LightMap[2];
	delete LightMap[3];
	delete LightMap[4];
	delete LightMap[5];
#else
	delete LightMap[0];
#endif
	delete bg;
	delete stars;
	//delete [] name;
	delete systemInputDFA;
	delete bolts;
	//  delete collidetable;//BAD BAD BAD we need this to happen later!

	//I *think* this is legacy 012603  GFXDeleteLightContext (lightcontext);

	_Universe->popActiveStarSystem();
	RemoveStarsystemFromUniverse();

}