void exit_app(void)
{
	(void)font_exit();
	(void)delete_history();
	(void)ftp_off();
	(void)InputExit();
	UnloadModules();
	exit(1);
}
mozJSComponentLoader::~mozJSComponentLoader()
{
    if (mInitialized) {
        NS_ERROR("'xpcom-shutdown-loaders' was not fired before cleaning up mozJSComponentLoader");
        UnloadModules();
    }

    NS_ASSERTION(!mFastLoadTimer,
                 "Fastload file should have been closed via xpcom-shutdown");

    sSelf = nsnull;
}
Example #3
0
int main(int argc, char *argv[])
{
  std::cout << "\nStarting TerraLib GeoWeb Services...\n" << std::endl;
  
  TerraLib::getInstance().initialize();
  
  

  try
  {
    tws::core::init_terralib_web_services();
    
    LoadModules();

    //std::unique_ptr<tws::core::http_server> server = tws::core::http_server_builder::instance().build(TWS_DEFAULT_WEB_SERVER);
    std::unique_ptr<tws::core::http_server> server = tws::core::http_server_builder::instance().build("mongoose");

    server->start();

    UnloadModules();
  }
  catch(const boost::exception& e)
  {
    if(const std::string* d = boost::get_error_info<tws::error_description>(e))
      std::cout << "\n\nthe following error has occurried: " << *d << std::endl;
    else
      std::cout << "\n\nan unknown error has occurried" << std::endl;

    return EXIT_FAILURE;
  }
  catch(const std::exception& e)
  {
    std::cout << "\n\nthe following error has occurried: " << e.what() << std::endl;

    return EXIT_FAILURE;
  }
  catch(...)
  {
    std::cout << "\n\nan unknown error has occurried." << std::endl;

    return EXIT_FAILURE;
  }
  
  
  TerraLib::getInstance().finalize();

  std::cout << "\nFinished TerraLib GeoWeb Services!\n" << std::endl;

  return EXIT_SUCCESS;
}
Example #4
0
void unload_modules()
{
#ifdef DISABLE_UNLOAD_UTILITY_MODULES
	UnloadModules();
#else
	//unload utility modules
	int i, ret;
	for (i = mod_utils_num - 1; i >= 0; i--) {
		dbg_printf("UNLoad utility module id  0x%08X\n", mod_utils[i]);
		ret = unload_util(mod_utils[i]);
		if (ret)
			scr_printf("WARNING! error unloading module 0x%X: 0x%08X\n",
				mod_utils[i], ret);
	}
#endif
	mod_loaded_num = 0;
}
Example #5
0
ModuleManager::~ModuleManager()
{
	UnloadModules();
}
Example #6
0
int main(int argc, char *argv[])
{
// look for tws_app_server config file
  std::string config_file_name = tws::core::find_in_app_path("share/tws/config/tws_app_server.json");

  if(config_file_name.empty())
  {
    std::cerr << TE_TR("Could not find tws_app_server configuration file: 'tws_app_server.json'.");

    return EXIT_FAILURE;
  }

  try
  {
// read config file
    std::unique_ptr<rapidjson::Document> config_doc(tws::core::open_json_file(config_file_name));

    if(!config_doc->IsObject() || config_doc->IsNull())
      throw tws::parse_error() << tws::error_description(TE_TR("error in array entry name in metadata."));

// get log file information
    const rapidjson::Value& jlog_file = (*config_doc)["log_file"];

    std::string log_file = jlog_file.GetString();

// init logger
    TE_INIT_DEFAULT_LOGGER(log_file);

// init TerraLib and TWS frameworks
    TE_LOG_INFO(TE_TR("Starting TerraLib GeoWeb Services..."));

    TerraLib::getInstance().initialize();

    tws::core::init_terralib_web_services();
    
    LoadModules();

// start default htp server
    const rapidjson::Value& jhttp_server = (*config_doc)["http_server"];

    std::string http_server = jhttp_server.GetString();

    std::unique_ptr<tws::core::http_server> server = tws::core::http_server_builder::instance().build(http_server);

    server->start();

    UnloadModules();

    TerraLib::getInstance().finalize();

    TE_LOG_INFO(TE_TR("Finished TerraLib GeoWeb Services!"));
  }
  catch(const boost::exception& e)
  {
    if(const std::string* d = boost::get_error_info<tws::error_description>(e))
    {
      boost::format err_msg(TE_TR("the following error has occurred: %1%."));

      TE_LOG_ERROR((err_msg % *d).str());
    }
    else
    {
      TE_LOG_ERROR(TE_TR("an unknown error has occurred"));
    }

    return EXIT_FAILURE;
  }
  catch(const std::exception& e)
  {
    boost::format err_msg(TE_TR("the following error has occurred: %1%."));

    TE_LOG_ERROR((err_msg % e.what()).str());

    return EXIT_FAILURE;
  }
  catch(...)
  {
    TE_LOG_ERROR(TE_TR("an unknown error has occurred."));

    return EXIT_FAILURE;
  }

  return EXIT_SUCCESS;
}
Example #7
0
void StopApp() {
	_gameState = 0; running = 0; sceUsbDeactivate(PSP_USBCAM_PID); StopUsb();
	FinishJpegDecoder(); UnloadModules();
}