winebus.sys: Free unix device in unix_device_remove.

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-09-14 08:58:24 +02:00 committed by Alexandre Julliard
parent bf1446523c
commit 1f12b2160d
5 changed files with 1 additions and 14 deletions

View File

@ -139,7 +139,6 @@ static void handle_IOHIDDeviceIOHIDReportCallback(void *context,
static void iohid_device_destroy(struct unix_device *iface)
{
unix_device_destroy(iface);
}
static int iohid_device_compare(struct unix_device *iface, void *context)

View File

@ -480,7 +480,6 @@ failed:
static void sdl_device_destroy(struct unix_device *iface)
{
unix_device_destroy(iface);
}
static int sdl_device_compare(struct unix_device *iface, void *context)

View File

@ -560,8 +560,6 @@ static void hidraw_device_destroy(struct unix_device *iface)
close(private->device_fd);
udev_device_unref(private->udev_device);
unix_device_destroy(iface);
}
static int udev_device_compare(struct unix_device *iface, void *platform_dev)
@ -814,8 +812,6 @@ static void lnxev_device_destroy(struct unix_device *iface)
close(ext->base.device_fd);
udev_device_unref(ext->base.udev_device);
unix_device_destroy(iface);
}
static DWORD CALLBACK lnxev_device_report_thread(void *args);

View File

@ -48,7 +48,6 @@ struct unix_device
};
extern void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size) DECLSPEC_HIDDEN;
extern void unix_device_destroy(struct unix_device *iface) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_init(void *) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_wait(void *) DECLSPEC_HIDDEN;

View File

@ -49,7 +49,6 @@ static void mouse_destroy(struct unix_device *iface)
{
struct mouse_device *impl = mouse_from_unix_device(iface);
hid_descriptor_free(&impl->desc);
unix_device_destroy(iface);
}
static int mouse_compare(struct unix_device *iface, void *context)
@ -154,7 +153,6 @@ static void keyboard_destroy(struct unix_device *iface)
{
struct keyboard_device *impl = keyboard_from_unix_device(iface);
hid_descriptor_free(&impl->desc);
unix_device_destroy(iface);
}
static int keyboard_compare(struct unix_device *iface, void *context)
@ -254,16 +252,12 @@ void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size)
return iface;
}
void unix_device_destroy(struct unix_device *iface)
{
HeapFree(GetProcessHeap(), 0, iface);
}
static NTSTATUS unix_device_remove(void *args)
{
struct unix_device *iface = args;
iface->vtbl->stop(iface);
iface->vtbl->destroy(iface);
HeapFree(GetProcessHeap(), 0, iface);
return STATUS_SUCCESS;
}