void UI_Main::shutdownRocket( void ) { int i; for( i = 0; i < UI_NUM_CONTEXTS; i++ ) { UI_Navigation &navigation = navigations[i]; for( UI_Navigation::iterator it = navigation.begin(); it != navigation.end(); ++it ) { // clear the navigation stack (*it)->popAllDocuments(); (*it)->getCache()->clearCaches(); } } // forget about all previously registed shaders rocketModule->clearShaderCache(); destroyDataSources(); destroyFormatters(); for( i = 0; i < UI_NUM_CONTEXTS; i++ ) { UI_Navigation &navigation = navigations[i]; while( !navigation.empty() ) { NavigationStack *stack = navigation.front(); __SAFE_DELETE_NULLIFY( stack ); navigation.pop_front(); } } __SAFE_DELETE_NULLIFY( rocketModule ); }
void UI_Main::shutdownRocket( void ) { // clear the navigation stack navigator->popAllDocuments(); // clear the navigation stack from previous installment navigator->getCache()->clearCaches(); destroyDataSources(); destroyFormatters(); __SAFE_DELETE_NULLIFY( navigator ); __SAFE_DELETE_NULLIFY( rocketModule ); }
RocketModule::~RocketModule() { if( context ) context->RemoveReference(); context = 0; if(rocketInitialized) Rocket::Core::Shutdown(); rocketInitialized = false; // instancers bye bye // std::for_each( elementInstancers.begin(), elementInstancers.end(), unref_object<Rocket::Core::ElementInstancer> ); __SAFE_DELETE_NULLIFY( fsInterface ); __SAFE_DELETE_NULLIFY( systemInterface ); __SAFE_DELETE_NULLIFY( renderInterface ); }
void UI_Main::destroyFormatters( void ) { __SAFE_DELETE_NULLIFY( levelshot_fmt ); __SAFE_DELETE_NULLIFY( datetime_fmt ); __SAFE_DELETE_NULLIFY( duration_fmt ); __SAFE_DELETE_NULLIFY( filetype_fmt ); __SAFE_DELETE_NULLIFY( colorcode_fmt ); __SAFE_DELETE_NULLIFY( empty_fmt ); __SAFE_DELETE_NULLIFY( serverflags_fmt ); }
RocketModule::~RocketModule() { if( fontProviderInterface ) fontProviderInterface->RemoveReference(); if( contextMain ) contextMain->RemoveReference(); contextMain = 0; if( contextQuick ) contextQuick->RemoveReference(); contextQuick = 0; if( rocketInitialized ) Rocket::Core::Shutdown(); rocketInitialized = false; __SAFE_DELETE_NULLIFY( fontProviderInterface ); __SAFE_DELETE_NULLIFY( fsInterface ); __SAFE_DELETE_NULLIFY( systemInterface ); __SAFE_DELETE_NULLIFY( renderInterface ); }
void UI_Main::destroyDataSources( void ) { __SAFE_DELETE_NULLIFY( serverBrowser ); __SAFE_DELETE_NULLIFY( gameTypes ); __SAFE_DELETE_NULLIFY( maps ); __SAFE_DELETE_NULLIFY( huds ); __SAFE_DELETE_NULLIFY( videoModes ); __SAFE_DELETE_NULLIFY( demos ); __SAFE_DELETE_NULLIFY( mods ); __SAFE_DELETE_NULLIFY( crosshairs ); __SAFE_DELETE_NULLIFY( tvchannels ); __SAFE_DELETE_NULLIFY( ircchannels ); __SAFE_DELETE_NULLIFY( gameajax ); __SAFE_DELETE_NULLIFY( playerModels ); __SAFE_DELETE_NULLIFY( vidProfiles ); }