portal: Add g_autoptr() defines for old GLib versions

We don't need to check for GLib 2.44 (the first release with g_autoptr()
support) since Flatpak requires that version in configure.ac.

Fixes https://github.com/flatpak/flatpak/issues/3403
This commit is contained in:
Matthew Leeds
2020-02-03 11:24:41 -08:00
committed by Alexander Larsson
parent 5d382f3211
commit 5a94edaef3

View File

@@ -50,6 +50,14 @@
#include "portal-impl.h"
#include "flatpak-permission-dbus.h"
/* GLib 2.47.92 was the first release to define these in gdbus-codegen */
#if !GLIB_CHECK_VERSION (2, 47, 92)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PortalFlatpakProxy, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PortalFlatpakSkeleton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PortalFlatpakUpdateMonitorProxy, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PortalFlatpakUpdateMonitorSkeleton, g_object_unref)
#endif
#define IDLE_TIMEOUT_SECS 10 * 60
static GHashTable *client_pid_data_hash = NULL;