diff options
author | Garrett Regier <garrettregier@gmail.com> | 2015-01-05 11:13:23 -0800 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2015-01-20 01:23:07 -0800 |
commit | f7f7a0ce63953c55eb5e7c9e515a622b767ae7b3 (patch) | |
tree | 239484cc43ad3f9d61b27a03f2edf1743a549b49 /loaders | |
parent | c280b2e105ea7377a91166db45c19563ad40e5a8 (diff) | |
download | libpeas-f7f7a0ce63953c55eb5e7c9e515a622b767ae7b3.tar.gz |
Set atpanic handler early in Lua plugin loader
Before if a panic occurred in the initialization code it
would go to the original atpanic handler.
Diffstat (limited to 'loaders')
-rw-r--r-- | loaders/lua5.1/peas-plugin-loader-lua.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/loaders/lua5.1/peas-plugin-loader-lua.c b/loaders/lua5.1/peas-plugin-loader-lua.c index 270a680..82184c9 100644 --- a/loaders/lua5.1/peas-plugin-loader-lua.c +++ b/loaders/lua5.1/peas-plugin-loader-lua.c @@ -473,6 +473,10 @@ peas_plugin_loader_lua_initialize (PeasPluginLoader *loader) return FALSE; } + /* Set before any other code is run */ + if (g_getenv ("PEAS_LUA_DEBUG") != NULL) + lua_atpanic (L, atpanic_handler); + luaL_openlibs (L); if (!peas_lua_utils_require (L, "lgi") || @@ -513,11 +517,6 @@ peas_plugin_loader_lua_initialize (PeasPluginLoader *loader) /* Pop lgi's module table */ lua_pop (L, 1); - if (g_getenv ("PEAS_LUA_DEBUG") != NULL) - { - lua_atpanic (L, atpanic_handler); - } - /* Initially the lock is taken by LGI, * release as we are not running Lua code */ |