Commit 8bc52f52 authored by Tim Schumacher's avatar Tim Schumacher Committed by Alexandre Julliard

joy.cpl: Check if effect is allocated before releasing it.

parent 7edbbe1e
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment