From d49393b339c47733c2eda207b8ba03d61db0a5a3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 23 Jul 2022 14:39:44 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamepad_destroy_attachment_monitor.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libgamepad_destroy_attachment_monitor.c (limited to 'libgamepad_destroy_attachment_monitor.c') diff --git a/libgamepad_destroy_attachment_monitor.c b/libgamepad_destroy_attachment_monitor.c new file mode 100644 index 0000000..bdddb83 --- /dev/null +++ b/libgamepad_destroy_attachment_monitor.c @@ -0,0 +1,15 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +void +libgamepad_destroy_attachment_monitor(LIBGAMEPAD_ATTACHMENT_MONITOR *monitor) +{ + if (monitor) { + if (monitor->monitor) + udev_monitor_unref(monitor->monitor); + if (monitor->udev) + udev_unref(monitor->udev); + free(monitor); + } +} -- cgit v1.2.3-70-g09d2