screen_destroy_device()

Destroy an input device and free associated resources

Synopsis:

#include <screen/screen.h>
int screen_destroy_device(screen_device_t dev)

Arguments:

dev
The handle of the input device that you want to destroy.

Library:

libscreen

Description:

If dev was created with screen_create_device_type(), then the function type for screen_destroy_device() is flushing execution. Otherwise, this function type is immediate execution.

This function destroys the input device object associated with the device handle, dev. Any resources created for this input device is released.

All input devices, whether created with screen_create_device_type() or not, must be destroyed with this function. If your input device wasn't created with screen_create_device_type(), it must be destroyed upon the receipt of a SCREEN_EVENT_CLOSE event. When the function type for screen_destroy_device() is flushing execution, any entries in the command buffer that have reference to this device are flushed and processed before destroying the device.

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).