Esempio n. 1
0
/*
* Qcommon_Shutdown
*/
void Qcommon_Shutdown( void )
{
	static qboolean isdown = qfalse;

	if( isdown )
	{
		printf( "Recursive shutdown\n" );
		return;
	}
	isdown = qtrue;

	Com_ScriptModule_Shutdown();
	CM_Shutdown();
	Netchan_Shutdown();
	NET_Shutdown();
	Key_Shutdown();

	Steam_UnloadLibrary();

	Qcommon_ShutdownCommands();
	Memory_ShutdownCommands();

	if( log_stats_file )
	{
		FS_FCloseFile( log_stats_file );
		log_stats_file = 0;
	}
	if( log_file )
	{
		FS_FCloseFile( log_file );
		log_file = 0;
	}
	logconsole = NULL;
	FS_Shutdown();

	wswcurl_cleanup();

	Dynvar_Shutdown();
	dynvars_initialized = qfalse;
	Cvar_Shutdown();
	Cmd_Shutdown();
	Cbuf_Shutdown();
	Memory_Shutdown();
	
	QMutex_Destroy( &com_print_mutex );

	QThreads_Shutdown();
}
Esempio n. 2
0
/*
* Steam_LoadLibrary
*/
void Steam_LoadLibrary( void ) {
	static steamlib_import_t import;
	dllfunc_t funcs[2];
	void *( *GetSteamLibAPI )( void * );

	assert( !steamlib_libhandle );

	import.Com_Error = (com_error_t)Com_Error;
	import.Com_Printf = Com_Printf;
	import.Com_DPrintf = Com_DPrintf;
	import.Cbuf_ExecuteText = Cbuf_ExecuteText;

	// load dynamic library
	Com_Printf( "Loading Steam module... " );
	funcs[0].name = "GetSteamLibAPI";
	funcs[0].funcPointer = (void **) &GetSteamLibAPI;
	funcs[1].name = NULL;
	steamlib_libhandle = Com_LoadLibrary( LIB_DIRECTORY "/" LIB_PREFIX "steamlib" LIB_SUFFIX, funcs );

	if( steamlib_libhandle ) {
		// load succeeded
		int api_version;

		steamlib_export = GetSteamLibAPI( &import );
		api_version = steamlib_export->API();

		if( api_version != STEAMLIB_API_VERSION ) {
			// wrong version
			Com_Printf( "Wrong version: %i, not %i.\n", api_version, STEAMLIB_API_VERSION );
			Steam_UnloadLibrary();
		} else {
			Com_Printf( "Success.\n" );
		}
	} else {
		Com_Printf( "Not found.\n" );
	}
}