mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 15:10:53 +00:00
libsysprof: add autoclean backports
This commit is contained in:
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#ifndef HAVE_POLKIT_AUTOPTR
|
#ifndef HAVE_POLKIT_AUTOPTR
|
||||||
# include <polkit/polkit.h>
|
# include <polkit/polkit.h>
|
||||||
|
|
||||||
@ -10,3 +12,14 @@
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
|
||||||
#endif
|
#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
|
||||||
|
|||||||
Reference in New Issue
Block a user