aboutsummaryrefslogtreecommitdiffstats
path: root/libgamepad_destroy_attachment_monitor.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-23 14:39:44 +0200
committerMattias Andrée <maandree@kth.se>2022-07-23 14:40:11 +0200
commitd49393b339c47733c2eda207b8ba03d61db0a5a3 (patch)
treebc609622c3cabe1dc6b59970cb8a9a8364a561a7 /libgamepad_destroy_attachment_monitor.c
downloadlibgamepad-d49393b339c47733c2eda207b8ba03d61db0a5a3.tar.gz
libgamepad-d49393b339c47733c2eda207b8ba03d61db0a5a3.tar.bz2
libgamepad-d49393b339c47733c2eda207b8ba03d61db0a5a3.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libgamepad_destroy_attachment_monitor.c15
1 files changed, 15 insertions, 0 deletions
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);
+ }
+}