aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-11 23:05:25 -0700
committerChris Robinson <[email protected]>2011-08-12 05:40:09 -0700
commita72c0f7470ff76c363810cfaf2a3fd6282cd8cc2 (patch)
treeb7550de7cb237e35d74b61a1c2b4b8c9f5b78038
parent45a245d7def739e9facf9eddddd1f5410595c74a (diff)
Use an existing function to clear and free the context
-rw-r--r--Alc/ALc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 0630d6af..653cb132 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1586,14 +1586,15 @@ static ALvoid InitContext(ALCcontext *pContext)
/*
- ExitContext
+ FreeContext
Clean up Context, destroy any remaining Sources
*/
-static ALCvoid ExitContext(ALCcontext *pContext)
+static ALCvoid FreeContext(ALCcontext *context)
{
//Invalidate context
- pContext->LastError = AL_NO_ERROR;
+ memset(context, 0, sizeof(ALCcontext));
+ free(context);
}
///////////////////////////////////////////////////////
@@ -2334,10 +2335,7 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
context->MaxActiveSources = 0;
context->ActiveSourceCount = 0;
- ExitContext(context);
-
- memset(context, 0, sizeof(ALCcontext));
- free(context);
+ FreeContext(context);
}