Commit 3223798d authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Make props array a part of the generic joystick struct.

It's much easier to free it on release.
parent aee42377
......@@ -462,11 +462,6 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
}
newDevice->generic.base.data_format.wine_df = df;
/* create default properties */
newDevice->generic.props = HeapAlloc(GetProcessHeap(),0,c_dfDIJoystick2.dwNumObjs*sizeof(ObjProps));
if (newDevice->generic.props == 0)
goto FAILED;
/* initialize default properties */
for (i = 0; i < c_dfDIJoystick2.dwNumObjs; i++) {
newDevice->generic.props[i].lDevMin = -32767;
......@@ -510,7 +505,6 @@ FAILED1:
release_DataFormat(&newDevice->generic.base.data_format);
HeapFree(GetProcessHeap(),0,newDevice->axis_map);
HeapFree(GetProcessHeap(),0,newDevice->generic.name);
HeapFree(GetProcessHeap(),0,newDevice->generic.props);
HeapFree(GetProcessHeap(),0,newDevice);
*pdev = 0;
......
......@@ -724,11 +724,6 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
}
newDevice->generic.base.data_format.wine_df = df;
/* create default properties */
newDevice->generic.props = HeapAlloc(GetProcessHeap(),0,c_dfDIJoystick2.dwNumObjs*sizeof(ObjProps));
if (newDevice->generic.props == 0)
goto FAILED;
/* initialize default properties */
get_osx_device_elements_props(newDevice);
......@@ -761,7 +756,6 @@ FAILED:
HeapFree(GetProcessHeap(), 0, df);
release_DataFormat(&newDevice->generic.base.data_format);
HeapFree(GetProcessHeap(),0,newDevice->generic.name);
HeapFree(GetProcessHeap(),0,newDevice->generic.props);
HeapFree(GetProcessHeap(),0,newDevice);
*pdev = 0;
......
......@@ -29,6 +29,8 @@
#include "dinput_private.h"
#include "device_private.h"
/* Number of objects in the default data format */
#define MAX_PROPS 164
struct JoystickGenericImpl;
typedef void joy_polldev_handler(struct JoystickGenericImpl *This);
......@@ -37,7 +39,7 @@ typedef struct JoystickGenericImpl
{
struct IDirectInputDevice2AImpl base;
ObjProps *props;
ObjProps props[MAX_PROPS];
DIDEVCAPS devcaps;
DIJOYSTATE2 js; /* wine data */
GUID guidProduct;
......
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