From 717571d25f80737dc7bb82d3c67942126595769a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 2 Nov 2019 08:26:14 +0000 Subject: [PATCH] gtkcompat.h: fix GTK1 implementation of ref_sink. I was testing some upcoming new GTK code against all GTK versions, which for once was interesting enough to make nontrivial use of g_object_ref_sink, and I found that I hadn't implemented the GTK1 fallback version right. GTK1 has no ref_sink call, but it does have ref and sink, so the right thing seems to be to just call them in succession. --- unix/gtkcompat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unix/gtkcompat.h b/unix/gtkcompat.h index b34eda10..6ab5c809 100644 --- a/unix/gtkcompat.h +++ b/unix/gtkcompat.h @@ -34,7 +34,10 @@ #define g_object_get_data gtk_object_get_data #define g_object_set_data gtk_object_set_data #define g_object_set_data_full gtk_object_set_data_full -#define g_object_ref_sink gtk_object_sink +#define g_object_ref_sink(x) do { \ + gtk_object_ref(x); \ + gtk_object_sink(x); \ + } while (0) #define GDK_GRAB_SUCCESS GrabSuccess