dinput: Free axis_map when joystick device is freed.

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=36263
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-31 10:23:58 +02:00 committed by Alexandre Julliard
parent 52aacd2377
commit 5cf67f00d0
5 changed files with 16 additions and 3 deletions

View file

@ -534,6 +534,17 @@ HRESULT WINAPI JoystickWGenericImpl_GetCapabilities(LPDIRECTINPUTDEVICE8W iface,
return DI_OK;
}
ULONG WINAPI JoystickWGenericImpl_Release(LPDIRECTINPUTDEVICE8W iface)
{
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
void *axis_map = This->axis_map;
ULONG res = IDirectInputDevice2WImpl_Release(iface);
if (!res) HeapFree(GetProcessHeap(), 0, axis_map);
return res;
}
/******************************************************************************
* GetObjectInfo : get object info
*/

View file

@ -786,7 +786,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
{
IDirectInputDevice2WImpl_QueryInterface,
IDirectInputDevice2WImpl_AddRef,
IDirectInputDevice2WImpl_Release,
JoystickWGenericImpl_Release,
JoystickWGenericImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects,
JoystickLinuxWImpl_GetProperty,

View file

@ -1231,7 +1231,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
{
IDirectInputDevice2WImpl_QueryInterface,
IDirectInputDevice2WImpl_AddRef,
IDirectInputDevice2WImpl_Release,
JoystickWGenericImpl_Release,
JoystickWGenericImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects,
JoystickWImpl_GetProperty,

View file

@ -1484,7 +1484,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
{
IDirectInputDevice2WImpl_QueryInterface,
IDirectInputDevice2WImpl_AddRef,
IDirectInputDevice2WImpl_Release,
JoystickWGenericImpl_Release,
JoystickWGenericImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects,
JoystickWImpl_GetProperty,

View file

@ -59,6 +59,8 @@ DWORD joystick_map_pov(const POINTL *p) DECLSPEC_HIDDEN;
BOOL device_disabled_registry(const char* name) DECLSPEC_HIDDEN;
ULONG WINAPI JoystickWGenericImpl_Release(LPDIRECTINPUTDEVICE8W iface);
HRESULT WINAPI JoystickWGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) DECLSPEC_HIDDEN;