From dd6df7589ed05c446c3fc208cd26bf879c2d291d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 16 Dec 2019 10:32:57 +0100 Subject: [PATCH] utils: Don't leak GMainContextPopDefault contextes We're creating a new one, making it the default, and on destroy we pop it, but since we're not also destroying it we're leaking the entire context! --- common/flatpak-utils-private.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/flatpak-utils-private.h b/common/flatpak-utils-private.h index c349d721..f13d82fc 100644 --- a/common/flatpak-utils-private.h +++ b/common/flatpak-utils-private.h @@ -645,7 +645,10 @@ flatpak_main_context_pop_default_destroy (void *p) GMainContext *main_context = p; if (main_context) - g_main_context_pop_thread_default (main_context); + { + g_main_context_pop_thread_default (main_context); + g_main_context_unref (main_context); + } } static inline GMainContextPopDefault *