From 1db7233496a66a0e30707204c988c752423e2969 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 11 Dec 2019 23:50:37 -0300 Subject: [PATCH] Test that the crash when we called print() on a __gc at exit is fixed --- scripts/print_on_gc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/print_on_gc.lua diff --git a/scripts/print_on_gc.lua b/scripts/print_on_gc.lua new file mode 100644 index 000000000..f39c50fce --- /dev/null +++ b/scripts/print_on_gc.lua @@ -0,0 +1,10 @@ +-- Copyright (C) 2019 Igara Studio S.A. +-- +-- This file is released under the terms of the MIT license. +-- Read LICENSE.txt for more information. + +-- Create global variable which will be GC'd on lua_close() +a = { } + +-- Call print() on __gc, in previous version this produced a crash at exit +setmetatable(a, { __gc=function() print('gc') end })