[sysprof/wip/chergert/sysprof-3] libsysprof: backport autoptr cleanups when necessary
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/chergert/sysprof-3] libsysprof: backport autoptr cleanups when necessary
- Date: Fri, 10 May 2019 19:54:12 +0000 (UTC)
commit 1aea1ce98e2bfbd3b93d46765d0cd067777c20b2
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]