summaryrefslogtreecommitdiff
path: root/src/ld-lua.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-09 06:46:48 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-09 07:08:39 +0100
commit54ef5ce450725e0594a93543d4de5914e2b5e102 (patch)
tree342de99b137b6aa2548ff3af9489866155c9f253 /src/ld-lua.c
parent8243114d0924982590fb81f0ecb54b39fef41c9e (diff)
downloadlogdiag-54ef5ce450725e0594a93543d4de5914e2b5e102.tar.gz
logdiag-54ef5ce450725e0594a93543d4de5914e2b5e102.tar.xz
logdiag-54ef5ce450725e0594a93543d4de5914e2b5e102.zip
Fix comments.
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++)
{