Commit 1f12b216 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Free unix device in unix_device_remove.

parent bf144652
...@@ -139,7 +139,6 @@ static void handle_IOHIDDeviceIOHIDReportCallback(void *context, ...@@ -139,7 +139,6 @@ static void handle_IOHIDDeviceIOHIDReportCallback(void *context,
static void iohid_device_destroy(struct unix_device *iface) static void iohid_device_destroy(struct unix_device *iface)
{ {
unix_device_destroy(iface);
} }
static int iohid_device_compare(struct unix_device *iface, void *context) static int iohid_device_compare(struct unix_device *iface, void *context)
......
...@@ -480,7 +480,6 @@ failed: ...@@ -480,7 +480,6 @@ failed:
static void sdl_device_destroy(struct unix_device *iface) static void sdl_device_destroy(struct unix_device *iface)
{ {
unix_device_destroy(iface);
} }
static int sdl_device_compare(struct unix_device *iface, void *context) static int sdl_device_compare(struct unix_device *iface, void *context)
......
...@@ -560,8 +560,6 @@ static void hidraw_device_destroy(struct unix_device *iface) ...@@ -560,8 +560,6 @@ static void hidraw_device_destroy(struct unix_device *iface)
close(private->device_fd); close(private->device_fd);
udev_device_unref(private->udev_device); udev_device_unref(private->udev_device);
unix_device_destroy(iface);
} }
static int udev_device_compare(struct unix_device *iface, void *platform_dev) 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) ...@@ -814,8 +812,6 @@ static void lnxev_device_destroy(struct unix_device *iface)
close(ext->base.device_fd); close(ext->base.device_fd);
udev_device_unref(ext->base.udev_device); udev_device_unref(ext->base.udev_device);
unix_device_destroy(iface);
} }
static DWORD CALLBACK lnxev_device_report_thread(void *args); static DWORD CALLBACK lnxev_device_report_thread(void *args);
......
...@@ -48,7 +48,6 @@ struct unix_device ...@@ -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_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_init(void *) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_wait(void *) DECLSPEC_HIDDEN; extern NTSTATUS sdl_bus_wait(void *) DECLSPEC_HIDDEN;
......
...@@ -49,7 +49,6 @@ static void mouse_destroy(struct unix_device *iface) ...@@ -49,7 +49,6 @@ static void mouse_destroy(struct unix_device *iface)
{ {
struct mouse_device *impl = mouse_from_unix_device(iface); struct mouse_device *impl = mouse_from_unix_device(iface);
hid_descriptor_free(&impl->desc); hid_descriptor_free(&impl->desc);
unix_device_destroy(iface);
} }
static int mouse_compare(struct unix_device *iface, void *context) static int mouse_compare(struct unix_device *iface, void *context)
...@@ -154,7 +153,6 @@ static void keyboard_destroy(struct unix_device *iface) ...@@ -154,7 +153,6 @@ static void keyboard_destroy(struct unix_device *iface)
{ {
struct keyboard_device *impl = keyboard_from_unix_device(iface); struct keyboard_device *impl = keyboard_from_unix_device(iface);
hid_descriptor_free(&impl->desc); hid_descriptor_free(&impl->desc);
unix_device_destroy(iface);
} }
static int keyboard_compare(struct unix_device *iface, void *context) 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) ...@@ -254,16 +252,12 @@ void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size)
return iface; return iface;
} }
void unix_device_destroy(struct unix_device *iface)
{
HeapFree(GetProcessHeap(), 0, iface);
}
static NTSTATUS unix_device_remove(void *args) static NTSTATUS unix_device_remove(void *args)
{ {
struct unix_device *iface = args; struct unix_device *iface = args;
iface->vtbl->stop(iface); iface->vtbl->stop(iface);
iface->vtbl->destroy(iface); iface->vtbl->destroy(iface);
HeapFree(GetProcessHeap(), 0, iface);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
......
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