Test that the crash when we called print() on a __gc at exit is fixed

This commit is contained in:
David Capello 2019-12-11 23:50:37 -03:00
parent 0fd04fd57f
commit 1db7233496

10
scripts/print_on_gc.lua Normal file
View File

@ -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 })