Fixed memory leak with luascript resource