SHA256
1
0
forked from pool/gjs
gjs/gjs-ensure-force_gc-flag-use.patch

36 lines
1.1 KiB
Diff
Raw Normal View History

From c0420db97ea574afe80664d3835995fba0c1e47b Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 25 Apr 2018 13:39:12 +0200
Subject: [PATCH] context: Ensure force_gc flag is not lost if the idle is scheduled
If the first caller that triggers the idle happens to be non-forcing,
all later forcing calls would be ignored.
https://gitlab.gnome.org/GNOME/gjs/issues/150
Closes: #150
---
gjs/context.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gjs/context.cpp b/gjs/context.cpp
index a2ce34a..e66a9f8 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -609,10 +609,11 @@ static void
_gjs_context_schedule_gc_internal(GjsContext *js_context,
bool force_gc)
{
+ js_context->force_gc |= force_gc;
+
if (js_context->auto_gc_id > 0)
return;
- js_context->force_gc |= force_gc;
js_context->auto_gc_id = g_idle_add_full(G_PRIORITY_LOW,
trigger_gc_if_needed,
js_context, NULL);
--
libgit2 0.27.0