Cleanup in InputDevice

This commit is contained in:
Kristóf Marussy 2020-12-14 19:49:28 +01:00
parent 1c209edaad
commit c261b6582c
No known key found for this signature in database
GPG Key ID: 59E156E31028BA29
2 changed files with 4 additions and 1 deletions

View File

@ -54,9 +54,11 @@ InputDevice::InputDevice(const char* name)
int err = libevdev_uinput_create_from_device(device,
LIBEVDEV_UINPUT_OPEN_MANAGED, &ui_device);
if(err != 0)
if(err != 0) {
libevdev_free(device);
throw std::system_error(-err, std::generic_category());
}
}
InputDevice::~InputDevice()
{

View File

@ -20,6 +20,7 @@
#define LOGID_INPUTDEVICE_H
#include <memory>
#include <string>
extern "C"
{