[gegl] bin: force manual iteration of lua gc before shutting down GEGL



commit 2531bd58944d45bca612bb57eef95efa6879816c
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu May 9 13:14:19 2019 +0200

    bin: force manual iteration of lua gc before shutting down GEGL
    
    This is a way to avoid the warnings seen in issue #142, using the lua
    interface code now is matching the pure C UI in not showing leaks during
    basic image opening/closing browsing.

 bin/ui-core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/bin/ui-core.c b/bin/ui-core.c
index 31bc95699..5bb572cb3 100644
--- a/bin/ui-core.c
+++ b/bin/ui-core.c
@@ -1065,12 +1065,18 @@ int mrg_ui_main (int argc, char **argv, char **ops)
   }
 
   mrg_main (mrg);
-
-
   has_quit = 1;
   if (renderer == GEGL_RENDERER_THREAD)
     g_thread_join (o->renderer_thread);
 
+#ifdef HAVE_LUA
+  /* manually run lua garbage collection before tearing down GEGL */
+  if(L)
+  {
+    lua_gc(L, LUA_GCCOLLECT, 0);
+  }
+#endif
+
   g_object_unref (o);
 
   gegl_exit ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]