aboutsummaryrefslogtreecommitdiff
path: root/src/ld-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ld-lua.c')
-rw-r--r--src/ld-lua.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ld-lua.c b/src/ld-lua.c
index 47f2a40..7976606 100644
--- a/src/ld-lua.c
+++ b/src/ld-lua.c
@@ -46,9 +46,9 @@ struct _LdLuaPrivate
};
/* registry.logdiag_symbols
- * -> table indexed by pointers to LdLuaSymbol objects
+ * -> A table indexed by pointers to LdLuaSymbol objects
* registry.logdiag_symbols.object.render(cr)
- * -> rendering function
+ * -> The rendering function
*/
#define LD_LUA_LIBRARY_NAME "logdiag"
@@ -197,7 +197,7 @@ ld_lua_init (LdLua *self)
lua_setfield (L, LUA_REGISTRYINDEX, LD_LUA_DATA_INDEX);
- /* Create an empty symbols table. */
+ /* Create an empty symbol table. */
lua_newtable (L);
lua_setfield (L, LUA_REGISTRYINDEX, LD_LUA_SYMBOLS_INDEX);
}
@@ -633,7 +633,11 @@ push_cairo_object (lua_State *L, LdLuaDrawData *draw_data)
/* XXX: The light user data pointer gets invalid after the end of
* "render" function invocation. If the script stores the "cr" object
* in some global variable and then tries to reuse it the next time,
- * the application will go SIGSEGV.
+ * the application may go SIGSEGV.
+ *
+ * The solution is creating a full user data instead, referencing
+ * the cairo object and dereferencing it upon garbage collection
+ * of the user data object.
*/
for (fn = ld_lua_cairo_table; fn->name; fn++)
{