[sysprof] libsysprof: backport autoptr cleanups when necessary
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof: backport autoptr cleanups when necessary
- Date: Wed, 29 May 2019 22:19:49 +0000 (UTC)
commit 280f4b9415b35faf97e8e672c3b1934a1c46dbb3
Author: Christian Hergert <chergert redhat com>
Date: Fri May 10 12:53:36 2019 -0700
libsysprof: backport autoptr cleanups when necessary
src/libsysprof/sysprof-backport-autocleanups.h | 12 ++++++++++++
src/libsysprof/sysprof-helpers.c | 1 +
2 files changed, 13 insertions(+)
---
diff --git a/src/libsysprof/sysprof-backport-autocleanups.h b/src/libsysprof/sysprof-backport-autocleanups.h
new file mode 100644
index 0000000..2ff3792
--- /dev/null
+++ b/src/libsysprof/sysprof-backport-autocleanups.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include "config.h"
+
+#ifndef HAVE_POLKIT_AUTOPTR
+# include <polkit/polkit.h>
+
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
+#endif
+
diff --git a/src/libsysprof/sysprof-helpers.c b/src/libsysprof/sysprof-helpers.c
index 87d0061..740806f 100644
--- a/src/libsysprof/sysprof-helpers.c
+++ b/src/libsysprof/sysprof-helpers.c
@@ -26,6 +26,7 @@
#include <polkit/polkit.h>
#include "sysprof-helpers.h"
+#include "sysprof-backport-autocleanups.h"
#include "helpers.h"
#include "ipc-service.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]