xinput: Clear instance data when a controller is hotplugged.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2019-10-22 15:00:43 -05:00 committed by Alexandre Julliard
parent 5417c3bfa4
commit b3cc2542cb
1 changed files with 3 additions and 0 deletions

View File

@ -195,6 +195,9 @@ static BOOL init_controller(xinput_controller *controller, PHIDP_PREPARSED_DATA
memcpy(private->device_path, device_path, size);
private->enabled = TRUE;
memset(&controller->state, 0, sizeof(controller->state));
memset(&controller->vibration, 0, sizeof(controller->vibration));
controller->platform_private = private;
controller->connected = TRUE;