Remove unnecessary NULL checks

This commit is contained in:
Chris Robinson 2013-03-13 23:36:45 -07:00
parent 3fd0f23e48
commit 2486f13dae
2 changed files with 14 additions and 22 deletions

View File

@ -58,18 +58,14 @@ static ALvoid ChorusDestroy(ALeffectState *effect)
{
ALchorusState *state = (ALchorusState*)effect;
if (state)
if(state)
{
if (state->SampleBufferLeft != NULL)
{
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
}
if (state->SampleBufferRight != NULL)
{
free(state->SampleBufferRight);
state->SampleBufferRight = NULL;
}
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
free(state->SampleBufferRight);
state->SampleBufferRight = NULL;
free(state);
}
}

View File

@ -58,18 +58,14 @@ static ALvoid FlangerDestroy(ALeffectState *effect)
{
ALflangerState *state = (ALflangerState*)effect;
if (state)
if(state)
{
if (state->SampleBufferLeft != NULL)
{
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
}
if (state->SampleBufferRight != NULL)
{
free(state->SampleBufferRight);
state->SampleBufferRight = NULL;
}
free(state->SampleBufferLeft);
state->SampleBufferLeft = NULL;
free(state->SampleBufferRight);
state->SampleBufferRight = NULL;
free(state);
}
}