don't shut down video in a thread
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "RageThreads.h"
|
||||||
#include "ArchHooks_Unix.h"
|
#include "ArchHooks_Unix.h"
|
||||||
#include "archutils/Unix/SignalHandler.h"
|
#include "archutils/Unix/SignalHandler.h"
|
||||||
#include "archutils/Unix/GetSysInfo.h"
|
#include "archutils/Unix/GetSysInfo.h"
|
||||||
@@ -12,8 +13,10 @@
|
|||||||
|
|
||||||
static void EmergencyShutdown( int signal )
|
static void EmergencyShutdown( int signal )
|
||||||
{
|
{
|
||||||
/* If we don't actually use SDL for video, this should be a no-op. */
|
/* If we don't actually use SDL for video, this should be a no-op. Only
|
||||||
if( SDL_WasInit(SDL_INIT_VIDEO) )
|
* do this if the main thread crashes; trying to shut down from
|
||||||
|
* another thread causes crashes (eg. GL may be using TLS). */
|
||||||
|
if( !strcmp(RageThread::GetCurThreadName(), "Main thread") && SDL_WasInit(SDL_INIT_VIDEO) )
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user