aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h10
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
11 files changed, 28 insertions, 26 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);
}
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h
index 6d5ad8bb..537f0a8a 100644
--- a/OpenAL32/Include/alAuxEffectSlot.h
+++ b/OpenAL32/Include/alAuxEffectSlot.h
@@ -14,7 +14,7 @@ typedef struct ALeffectState ALeffectState;
typedef struct ALeffectslot ALeffectslot;
struct ALeffectStateVtable {
- ALvoid (*const Destroy)(ALeffectState *state);
+ ALvoid (*const Destruct)(ALeffectState *state);
ALboolean (*const DeviceUpdate)(ALeffectState *state, ALCdevice *device);
ALvoid (*const Update)(ALeffectState *state, ALCdevice *device, const ALeffectslot *slot);
ALvoid (*const Process)(ALeffectState *state, ALuint samplesToDo, const ALfloat *RESTRICT samplesIn, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE]);
@@ -25,15 +25,15 @@ struct ALeffectState {
const struct ALeffectStateVtable *vtbl;
};
-#define ALeffectState_Destroy(a) ((a)->vtbl->Destroy((a)))
+#define ALeffectState_Destruct(a) ((a)->vtbl->Destruct((a)))
#define ALeffectState_DeviceUpdate(a,b) ((a)->vtbl->DeviceUpdate((a),(b)))
#define ALeffectState_Update(a,b,c) ((a)->vtbl->Update((a),(b),(c)))
#define ALeffectState_Process(a,b,c,d) ((a)->vtbl->Process((a),(b),(c),(d)))
#define ALeffectState_getCreator(a) ((a)->vtbl->getCreator())
#define DEFINE_ALEFFECTSTATE_VTABLE(T) \
-static ALvoid T##_ALeffectState_Destroy(ALeffectState *state) \
-{ T##_Destroy(STATIC_UPCAST(T, ALeffectState, state)); } \
+static ALvoid T##_ALeffectState_Destruct(ALeffectState *state) \
+{ T##_Destruct(STATIC_UPCAST(T, ALeffectState, state)); } \
static ALboolean T##_ALeffectState_DeviceUpdate(ALeffectState *state, ALCdevice *device) \
{ return T##_DeviceUpdate(STATIC_UPCAST(T, ALeffectState, state), device); } \
static ALvoid T##_ALeffectState_Update(ALeffectState *state, ALCdevice *device, const ALeffectslot *slot) \
@@ -44,7 +44,7 @@ static ALeffectStateFactory* T##_ALeffectState_getCreator(void) \
{ return T##_getCreator(); } \
\
static const struct ALeffectStateVtable T##_ALeffectState_vtable = { \
- T##_ALeffectState_Destroy, \
+ T##_ALeffectState_Destruct, \
T##_ALeffectState_DeviceUpdate, \
T##_ALeffectState_Update, \
T##_ALeffectState_Process, \
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 0daeaeb1..4003d440 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -411,7 +411,7 @@ typedef struct ALnoneState {
DERIVE_FROM_TYPE(ALeffectState);
} ALnoneState;
-static ALvoid ALnoneState_Destroy(ALnoneState *state)
+static ALvoid ALnoneState_Destruct(ALnoneState *state)
{
(void)state;
}
@@ -456,7 +456,7 @@ ALeffectState *ALnoneStateFactory_create(void)
static ALvoid ALnoneStateFactory_destroy(ALeffectState *effect)
{
ALnoneState *state = STATIC_UPCAST(ALnoneState, ALeffectState, effect);
- ALnoneState_Destroy(state);
+ ALnoneState_Destruct(state);
free(state);
}