From 4d74a04c21944213fd1891d734c03895d6ebd8bf Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 18 Nov 2011 09:52:58 +0000 Subject: [PATCH] Maybe one day raster will remember. Something to do with caches perhaps? Needs to be changed anyway. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@65383 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_lua2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/edje_lua2.c b/src/lib/edje_lua2.c index 87db01f..e5f1eac 100644 --- a/src/lib/edje_lua2.c +++ b/src/lib/edje_lua2.c @@ -1,6 +1,8 @@ #include "edje_private.h" #include +#define RASTER_FORGOT_WHY "this is here." + #ifdef _WIN32 # define FMT_SIZE_T "%Iu" #else @@ -121,7 +123,9 @@ static void _elua_add_functions(lua_State *L, const char *api, const luaL_Reg *f static Eina_Bool _elua_isa(Edje_Lua_Obj *obj, const char *type); //--------------------------------------------------------------------------// +#ifndef RASTER_FORGOT_WHY static lua_State *lstate = NULL; +#endif static const char *_elua_key = "key"; static const char *_elua_objs = "objs"; static jmp_buf panic_jmp; @@ -3196,6 +3200,7 @@ _elua_isa(Edje_Lua_Obj *obj, const char *type) return isa; } +#ifndef RASTER_FORGOT_WHY static void _elua_init(void) // Stack usage [-?, +?, ?] { @@ -3233,6 +3238,7 @@ _elua_init(void) // Stack usage [-?, +?, ?] lua_rawset(L, -3); lua_rawset(L, LUA_REGISTRYINDEX); } +#endif void _edje_lua2_script_init(Edje *ed) // Stack usage [-?, +?, ?] @@ -3254,7 +3260,9 @@ _edje_lua2_script_init(Edje *ed) // Stack usage [-?, +?, ?] eina_log_domain_level_set("lua", EINA_LOG_LEVEL_INFO); } +#ifndef RASTER_FORGOT_WHY _elua_init(); +#endif L = ed->L = lua_newstate(_elua_alloc, &ela); lua_atpanic(L, _elua_custom_panic); @@ -3358,17 +3366,21 @@ _edje_lua2_script_shutdown(Edje *ed) void _edje_lua2_script_load(Edje_Part_Collection *edc __UNUSED__, void *data __UNUSED__, int size __UNUSED__) { +#ifndef RASTER_FORGOT_WHY _elua_init(); +#endif } void _edje_lua2_script_unload(Edje_Part_Collection *edc __UNUSED__) // Stack usage [-?, +?, ?] { +#ifndef RASTER_FORGOT_WHY lua_State *L; if (!lstate) return; L = lstate; lua_gc(L, LUA_GCCOLLECT, 0); +#endif } void -- 2.7.4