joy.cpl: Check if effect is allocated before releasing it.
Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7edbbe1ed3
commit
8bc52f5250
|
@ -137,7 +137,8 @@ static void destroy_joysticks(struct JoystickData *data)
|
|||
if (data->joysticks[i].forcefeedback && data->joysticks[i].num_effects > 0)
|
||||
{
|
||||
for (j = 0; j < data->joysticks[i].num_effects; j++)
|
||||
IDirectInputEffect_Release(data->joysticks[i].effects[j].effect);
|
||||
if (data->joysticks[i].effects[j].effect)
|
||||
IDirectInputEffect_Release(data->joysticks[i].effects[j].effect);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, data->joysticks[i].effects);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue