aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-08-21 02:27:56 -0700
committerChris Robinson <[email protected]>2014-08-21 02:27:56 -0700
commit65d2e0eb8d8c2af6e36586299bca23c014167b24 (patch)
tree9ee207678d64d90cb2140a0ac39f40028600bcef /Alc/ALc.c
parentb92e643e9742765acd364bcbe30ebaedbe50400f (diff)
Use an array of objects for active sources instead of pointers
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 53295fa0..7eefd9d1 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1924,7 +1924,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
for(pos = 0;pos < context->ActiveSourceCount;pos++)
{
- ALactivesource *src = context->ActiveSources[pos];
+ ALactivesource *src = &context->ActiveSources[pos];
ALsource *source = src->Source;
ALuint s = device->NumAuxSends;
@@ -1937,8 +1937,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(source)
{
- src->Update(src, source, context);
ATOMIC_STORE(&source->NeedsUpdate, AL_FALSE);
+ src->Update(src, source, context);
}
}
@@ -2141,10 +2141,8 @@ static ALvoid InitContext(ALCcontext *Context)
* Cleans up the context, and destroys any remaining objects the app failed to
* delete. Called once there's no more references on the context.
*/
-static ALCvoid FreeContext(ALCcontext *context)
+static void FreeContext(ALCcontext *context)
{
- ALsizei i;
-
TRACE("%p\n", context);
if(context->SourceMap.size > 0)
@@ -2161,11 +2159,6 @@ static ALCvoid FreeContext(ALCcontext *context)
}
ResetUIntMap(&context->EffectSlotMap);
- for(i = 0;i < context->MaxActiveSources;i++)
- {
- al_free(context->ActiveSources[i]);
- context->ActiveSources[i] = NULL;
- }
free(context->ActiveSources);
context->ActiveSources = NULL;
context->ActiveSourceCount = 0;