Commit fc30cfc2 authored by Christian Hergert's avatar Christian Hergert

backport weak pointers

parent a2ce8a6c
......@@ -24,6 +24,7 @@
#include "sysprof-display.h"
#include "sysprof-tab.h"
#include "sysprof-ui-private.h"
struct _SysprofTab
{
......
......@@ -47,4 +47,11 @@ void _sysprof_rounded_rectangle (cairo_t
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofMarkStat, _sysprof_mark_stat_free)
#if !GLIB_CHECK_VERSION(2, 56, 0)
# define g_clear_weak_pointer(ptr) \
(*(ptr) ? (g_object_remove_weak_pointer((GObject*)*(ptr), (gpointer*)ptr),*(ptr)=NULL,1) : 0)
# define g_set_weak_pointer(ptr,obj) \
((obj!=*(ptr))?(g_clear_weak_pointer(ptr),*(ptr)=obj,((obj)?g_object_add_weak_pointer((GObject*)obj,(gpointer*)ptr),NULL:NULL),1):0)
#endif
G_END_DECLS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment