openal32: Pass invalid contexts to the host OpenAL lib so it can set the proper error state.

This commit is contained in:
Chris Robinson 2009-09-10 12:12:08 -07:00 committed by Alexandre Julliard
parent 3b6ac3000f
commit 19bc84c86d
1 changed files with 3 additions and 6 deletions

View File

@ -175,15 +175,11 @@ ALCboolean CDECL wine_alcMakeContextCurrent(ALCcontext *context)
EnterCriticalSection(&openal_cs); EnterCriticalSection(&openal_cs);
if(context && !(ctx=ValidateCtx(context))) if(context && !(ctx=ValidateCtx(context)))
{
FIXME("Could not find context %p in context list\n", context); FIXME("Could not find context %p in context list\n", context);
LeaveCriticalSection(&openal_cs);
return ALC_FALSE;
}
if(alcMakeContextCurrent(ctx ? ctx->ctx : NULL) == ALC_FALSE) if(alcMakeContextCurrent(context) == ALC_FALSE)
{ {
WARN("Failed to make context %p current\n", ctx->ctx); WARN("Failed to make context %p current\n", context);
LeaveCriticalSection(&openal_cs); LeaveCriticalSection(&openal_cs);
return ALC_FALSE; return ALC_FALSE;
} }
@ -257,6 +253,7 @@ ALvoid CDECL wine_alcDestroyContext(ALCcontext *context)
if(!(*list)) if(!(*list))
{ {
FIXME("Could not find context %p in context list\n", context); FIXME("Could not find context %p in context list\n", context);
alcDestroyContext(context);
LeaveCriticalSection(&openal_cs); LeaveCriticalSection(&openal_cs);
return; return;
} }