summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c8
-rw-r--r--Alc/alcChorus.c4
-rw-r--r--Alc/alcDedicated.c4
-rw-r--r--Alc/alcDistortion.c4
-rw-r--r--Alc/alcEcho.c4
-rw-r--r--Alc/alcEqualizer.c4
-rw-r--r--Alc/alcFlanger.c4
-rw-r--r--Alc/alcModulator.c4
-rw-r--r--Alc/alcReverb.c4
9 files changed, 21 insertions, 19 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index aaddfea8..a3012650 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1777,8 +1777,9 @@ static ALCvoid FreeDevice(ALCdevice *device)
if(device->DefaultSlot)
{
- ALeffectState_Destroy(device->DefaultSlot->EffectState);
- device->DefaultSlot->EffectState = NULL;
+ ALeffectState *state = device->DefaultSlot->EffectState;
+ device->DefaultSlot = NULL;
+ ALeffectStateFactory_destroy(ALeffectState_getCreator(state), state);
}
if(device->BufferMap.size > 0)
@@ -2899,8 +2900,9 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
}
else if(InitializeEffect(device, device->DefaultSlot, &DefaultEffect) != AL_NO_ERROR)
{
- ALeffectState_Destroy(device->DefaultSlot->EffectState);
+ ALeffectState *state = device->DefaultSlot->EffectState;
device->DefaultSlot = NULL;
+ ALeffectStateFactory_destroy(ALeffectState_getCreator(state), state);
ERR("Failed to initialize the default effect\n");
}
}
diff --git a/Alc/alcChorus.c b/Alc/alcChorus.c
index 018caac5..cf414bbd 100644
--- a/Alc/alcChorus.c
+++ b/Alc/alcChorus.c
@@ -57,7 +57,7 @@ typedef struct ALchorusState {
ALfloat feedback;
} ALchorusState;
-static ALvoid ALchorusState_Destroy(ALchorusState *state)
+static ALvoid ALchorusState_Destruct(ALchorusState *state)
{
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
@@ -270,7 +270,7 @@ static ALeffectState *ALchorusStateFactory_create(void)
static ALvoid ALchorusStateFactory_destroy(ALeffectState *effect)
{
ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect);
- ALchorusState_Destroy(state);
+ ALchorusState_Destruct(state);
free(state);
}
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c
index fbe2a5f1..dd59c2c5 100644
--- a/Alc/alcDedicated.c
+++ b/Alc/alcDedicated.c
@@ -43,7 +43,7 @@ typedef struct ALdedicatedState {
} ALdedicatedState;
-static ALvoid ALdedicatedState_Destroy(ALdedicatedState *state)
+static ALvoid ALdedicatedState_Destruct(ALdedicatedState *state)
{
(void)state;
}
@@ -111,7 +111,7 @@ ALeffectState *ALdedicatedStateFactory_create(void)
static ALvoid ALdedicatedStateFactory_destroy(ALeffectState *effect)
{
ALdedicatedState *state = STATIC_UPCAST(ALdedicatedState, ALeffectState, effect);
- ALdedicatedState_Destroy(state);
+ ALdedicatedState_Destruct(state);
free(state);
}
diff --git a/Alc/alcDistortion.c b/Alc/alcDistortion.c
index ec48ad03..8f52ab5d 100644
--- a/Alc/alcDistortion.c
+++ b/Alc/alcDistortion.c
@@ -67,7 +67,7 @@ typedef struct ALdistortionState {
ALfloat edge_coeff;
} ALdistortionState;
-static ALvoid ALdistortionState_Destroy(ALdistortionState *state)
+static ALvoid ALdistortionState_Destruct(ALdistortionState *state)
{
(void)state;
}
@@ -266,7 +266,7 @@ static ALeffectState *ALdistortionStateFactory_create(void)
static ALvoid ALdistortionStateFactory_destroy(ALeffectState *effect)
{
ALdistortionState *state = STATIC_UPCAST(ALdistortionState, ALeffectState, effect);
- ALdistortionState_Destroy(state);
+ ALdistortionState_Destruct(state);
free(state);
}
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index e38e1457..4270c863 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -57,7 +57,7 @@ typedef struct ALechoState {
FILTER iirFilter;
} ALechoState;
-static ALvoid ALechoState_Destroy(ALechoState *state)
+static ALvoid ALechoState_Destruct(ALechoState *state)
{
free(state->SampleBuffer);
state->SampleBuffer = NULL;
@@ -208,7 +208,7 @@ ALeffectState *ALechoStateFactory_create(void)
static ALvoid ALechoStateFactory_destroy(ALeffectState *effect)
{
ALechoState *state = STATIC_UPCAST(ALechoState, ALeffectState, effect);
- ALechoState_Destroy(state);
+ ALechoState_Destruct(state);
free(state);
}
diff --git a/Alc/alcEqualizer.c b/Alc/alcEqualizer.c
index 5a1d8841..2c8eb131 100644
--- a/Alc/alcEqualizer.c
+++ b/Alc/alcEqualizer.c
@@ -102,7 +102,7 @@ typedef struct ALequalizerState {
ALEQFilter bandfilter[4];
} ALequalizerState;
-static ALvoid ALequalizerState_Destroy(ALequalizerState *state)
+static ALvoid ALequalizerState_Destruct(ALequalizerState *state)
{
(void)state;
}
@@ -308,7 +308,7 @@ ALeffectState *ALequalizerStateFactory_create(void)
static ALvoid ALequalizerStateFactory_destroy(ALeffectState *effect)
{
ALequalizerState *state = STATIC_UPCAST(ALequalizerState, ALeffectState, effect);
- ALequalizerState_Destroy(state);
+ ALequalizerState_Destruct(state);
free(state);
}
diff --git a/Alc/alcFlanger.c b/Alc/alcFlanger.c
index 953828f6..b3f09018 100644
--- a/Alc/alcFlanger.c
+++ b/Alc/alcFlanger.c
@@ -57,7 +57,7 @@ typedef struct ALflangerState {
ALfloat feedback;
} ALflangerState;
-static ALvoid ALflangerState_Destroy(ALflangerState *state)
+static ALvoid ALflangerState_Destruct(ALflangerState *state)
{
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
@@ -270,7 +270,7 @@ ALeffectState *ALflangerStateFactory_create(void)
static ALvoid ALflangerStateFactory_destroy(ALeffectState *effect)
{
ALflangerState *state = STATIC_UPCAST(ALflangerState, ALeffectState, effect);
- ALflangerState_Destroy(state);
+ ALflangerState_Destruct(state);
free(state);
}
diff --git a/Alc/alcModulator.c b/Alc/alcModulator.c
index 25b5bcc4..847027e6 100644
--- a/Alc/alcModulator.c
+++ b/Alc/alcModulator.c
@@ -135,7 +135,7 @@ DECL_TEMPLATE(Square)
#undef DECL_TEMPLATE
-static ALvoid ALmodulatorState_Destroy(ALmodulatorState *state)
+static ALvoid ALmodulatorState_Destruct(ALmodulatorState *state)
{
(void)state;
}
@@ -225,7 +225,7 @@ static ALeffectState *ALmodulatorStateFactory_create(void)
static ALvoid ALmodulatorStateFactory_destroy(ALeffectState *effect)
{
ALmodulatorState *state = STATIC_UPCAST(ALmodulatorState, ALeffectState, effect);
- ALmodulatorState_Destroy(state);
+ ALmodulatorState_Destruct(state);
free(state);
}
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index b3de2fad..e7dad6bb 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -1178,7 +1178,7 @@ static ALvoid ALreverbState_Update(ALreverbState *State, ALCdevice *Device, cons
// This destroys the reverb state. It should be called only when the effect
// slot has a different (or no) effect loaded over the reverb effect.
-static ALvoid ALreverbState_Destroy(ALreverbState *State)
+static ALvoid ALreverbState_Destruct(ALreverbState *State)
{
free(State->SampleBuffer);
State->SampleBuffer = NULL;
@@ -1287,7 +1287,7 @@ static ALeffectState *ALreverbStateFactory_create(void)
static ALvoid ALreverbStateFactory_destroy(ALeffectState *effect)
{
ALreverbState *state = STATIC_UPCAST(ALreverbState, ALeffectState, effect);
- ALreverbState_Destroy(state);
+ ALreverbState_Destruct(state);
free(state);
}