changeset 765:a49358b040b5

Doc on how to manage life-cycle of paints for JS
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 29 Aug 2010 00:42:16 +0800
parents 194e24d8ecab
children be0e02948c1d
files nodejs/paints.cc
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/paints.cc	Sun Aug 29 00:32:12 2010 +0800
+++ b/nodejs/paints.cc	Sun Aug 29 00:42:16 2010 +0800
@@ -18,6 +18,17 @@
  * @{
  */
 
+/*! \page paint_gc How to manage life-cycle of paints?
+ *
+ * A paint is used to fill and stroke shapes.  It should keep live
+ * before all shapes being stroked/or filled by it are dead or
+ * filled/stroked by other paints.  So, every shape that uses a paint
+ * should keep a reference to the paint.  The reference are removed
+ * when a shape is filled/or stroked by other paints.
+ *
+ * A paint should keep a weak reference to itself.  It is used to free
+ * resource before it being collected.
+ */
 static void
 xnjsmb_paint_fill(paint_t *paint, Handle<Object> self, shape_t *sh) {
     Handle<Value> rt_v;