Don't return error from alGetError() if there is no context

master
Marc Salem 2012-11-08 15:58:04 -08:00
parent b8cadf5d51
commit 5136d4d204
2 changed files with 4 additions and 2 deletions

View File

@ -356,7 +356,7 @@ static ALCuint g_ulContextCount = 0;
// Thread-local current context
static tls_type LocalContext;
// Process-wide current context
static ALCcontext *GlobalContext;
static ALCcontext *GlobalContext = NULL;
// Context Error
static ALCenum g_eLastNullDeviceError = ALC_NO_ERROR;

View File

@ -30,7 +30,9 @@ AL_API ALenum AL_APIENTRY alGetError(ALvoid)
ALenum errorCode;
Context = GetContextSuspended();
if(!Context) return AL_INVALID_OPERATION;
if(!Context) {
return AL_NO_ERROR;
}
errorCode = Context->LastError;
Context->LastError = AL_NO_ERROR;