aboutsummaryrefslogtreecommitdiffstats
path: root/libgamepad_destroy_attachment_monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgamepad_destroy_attachment_monitor.c')
-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);
+ }
+}