Cleanup in InputDevice
This commit is contained in:
@@ -54,8 +54,10 @@ InputDevice::InputDevice(const char* name)
|
|||||||
int err = libevdev_uinput_create_from_device(device,
|
int err = libevdev_uinput_create_from_device(device,
|
||||||
LIBEVDEV_UINPUT_OPEN_MANAGED, &ui_device);
|
LIBEVDEV_UINPUT_OPEN_MANAGED, &ui_device);
|
||||||
|
|
||||||
if(err != 0)
|
if(err != 0) {
|
||||||
|
libevdev_free(device);
|
||||||
throw std::system_error(-err, std::generic_category());
|
throw std::system_error(-err, std::generic_category());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InputDevice::~InputDevice()
|
InputDevice::~InputDevice()
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#define LOGID_INPUTDEVICE_H
|
#define LOGID_INPUTDEVICE_H
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user