aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-29 23:03:59 -0700
committerChris Robinson <[email protected]>2011-05-29 23:03:59 -0700
commite98104dac88db27bf5ed66980511f4034111e109 (patch)
tree6f871dc1a940a383603c60b9ff9ae82b9860ec88 /Alc/ALc.c
parent884f668855cea624165653f212fbec016d017a59 (diff)
Avoid holding locks once the context is removed from the lists
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 3c547d4a..8ba50ad8 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2125,9 +2125,8 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
break;
}
}
-
- // Lock context
- SuspendContext(context);
+ ProcessContext(NULL);
+ UnlockLists();
if(context->SourceMap.size > 0)
{
@@ -2152,14 +2151,8 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
context->MaxActiveSources = 0;
context->ActiveSourceCount = 0;
- // Unlock context
- ProcessContext(context);
- ProcessContext(NULL);
- UnlockLists();
-
ExitContext(context);
- // Free memory (MUST do this after ProcessContext)
memset(context, 0, sizeof(ALCcontext));
free(context);
}