[sysprof] libsysprof: add autoclean backports
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof: add autoclean backports
- Date: Wed, 29 May 2019 22:21:40 +0000 (UTC)
commit f6980c0b9e02e7d2c72e11176ba4c1a88b8aa6fb
Author: Christian Hergert <chergert redhat com>
Date: Fri May 10 19:32:32 2019 -0700
libsysprof: add autoclean backports
src/libsysprof/sysprof-backport-autocleanups.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/src/libsysprof/sysprof-backport-autocleanups.h b/src/libsysprof/sysprof-backport-autocleanups.h
index 2ff3792..51eaba8 100644
--- a/src/libsysprof/sysprof-backport-autocleanups.h
+++ b/src/libsysprof/sysprof-backport-autocleanups.h
@@ -2,6 +2,8 @@
#include "config.h"
+#include <glib.h>
+
#ifndef HAVE_POLKIT_AUTOPTR
# include <polkit/polkit.h>
@@ -10,3 +12,14 @@
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
#endif
+#if !GLIB_CHECK_VERSION(2, 56, 0)
+ static inline void
+ g_clear_handle_id (guint *ptr,
+ void (*clear_func) (guint handle_id))
+ {
+ guint id = *ptr;
+ *ptr = 0;
+ if (id)
+ clear_func (handle_id);
+ }
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]