Commit 0c31653a authored by Garrett Regier's avatar Garrett Regier

Fix panic when getting global LGI fields

A panic will occur when using lua_getfield() as LGI
will attempt to find the value as a typelib. This breaks
the attempt to report an incorrect LGI version and
causes a crash.
parent 826f902e
......@@ -486,15 +486,18 @@ peas_plugin_loader_lua_initialize (PeasPluginLoader *loader)
return FALSE;
}
lua_getfield (L, -1, "lock");
lua_pushliteral (L, "lock");
lua_rawget (L, -2);
priv->lgi_lock = lua_touserdata (L, -1);
lua_pop (L, 1);
lua_getfield (L, -1, "enter");
lua_pushliteral (L, "enter");
lua_rawget (L, -2);
priv->lgi_enter_func = lua_touserdata (L, -1);
lua_pop (L, 1);
lua_getfield (L, -1, "leave");
lua_pushliteral (L, "leave");
lua_rawget (L, -2);
priv->lgi_leave_func = lua_touserdata (L, -1);
lua_pop (L, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment