aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alcChorus.c14
-rw-r--r--Alc/alcEcho.c11
-rw-r--r--Alc/alcFlanger.c14
-rw-r--r--Alc/alcReverb.c11
4 files changed, 22 insertions, 28 deletions
diff --git a/Alc/alcChorus.c b/Alc/alcChorus.c
index 5f360d17..f02544c4 100644
--- a/Alc/alcChorus.c
+++ b/Alc/alcChorus.c
@@ -53,16 +53,14 @@ typedef struct ALchorusState {
static ALvoid ChorusDestroy(ALeffectState *effect)
{
ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect);
- if(state)
- {
- free(state->SampleBufferLeft);
- state->SampleBufferLeft = NULL;
- free(state->SampleBufferRight);
- state->SampleBufferRight = NULL;
+ free(state->SampleBufferLeft);
+ state->SampleBufferLeft = NULL;
- free(state);
- }
+ free(state->SampleBufferRight);
+ state->SampleBufferRight = NULL;
+
+ free(state);
}
static ALboolean ChorusDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index 297d6e76..b4663ade 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -54,12 +54,11 @@ typedef struct ALechoState {
static ALvoid EchoDestroy(ALeffectState *effect)
{
ALechoState *state = STATIC_UPCAST(ALechoState, ALeffectState, effect);
- if(state)
- {
- free(state->SampleBuffer);
- state->SampleBuffer = NULL;
- free(state);
- }
+
+ free(state->SampleBuffer);
+ state->SampleBuffer = NULL;
+
+ free(state);
}
static ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
diff --git a/Alc/alcFlanger.c b/Alc/alcFlanger.c
index 7c753eb6..d7a59f3a 100644
--- a/Alc/alcFlanger.c
+++ b/Alc/alcFlanger.c
@@ -53,16 +53,14 @@ typedef struct ALflangerState {
static ALvoid FlangerDestroy(ALeffectState *effect)
{
ALflangerState *state = STATIC_UPCAST(ALflangerState, ALeffectState, effect);
- if(state)
- {
- free(state->SampleBufferLeft);
- state->SampleBufferLeft = NULL;
- free(state->SampleBufferRight);
- state->SampleBufferRight = NULL;
+ free(state->SampleBufferLeft);
+ state->SampleBufferLeft = NULL;
- free(state);
- }
+ free(state->SampleBufferRight);
+ state->SampleBufferRight = NULL;
+
+ free(state);
}
static ALboolean FlangerDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index 71b21e1b..6de2c66f 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -1174,12 +1174,11 @@ static ALvoid ReverbUpdate(ALeffectState *effect, ALCdevice *Device, const ALeff
static ALvoid ReverbDestroy(ALeffectState *effect)
{
ALverbState *State = STATIC_UPCAST(ALverbState, ALeffectState, effect);
- if(State)
- {
- free(State->SampleBuffer);
- State->SampleBuffer = NULL;
- free(State);
- }
+
+ free(State->SampleBuffer);
+ State->SampleBuffer = NULL;
+
+ free(State);
}
// This creates the reverb state. It should be called only when the reverb