changeset 771:01b514800fbe

Fix logic error of checking clear flag for paint.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 29 Aug 2010 19:06:24 +0800
parents abd9bbf24545
children 11f062c2c0b8
files nodejs/paints.cc src/redraw_man.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/paints.cc	Sun Aug 29 18:48:20 2010 +0800
+++ b/nodejs/paints.cc	Sun Aug 29 19:06:24 2010 +0800
@@ -35,12 +35,14 @@
     paint_t *paint;
     Handle<Object> rt;
     redraw_man_t *rdman;
+    int r;
     
     paint = (paint_t *)UNWRAP(*paint_hdl);
     rt = GET(*paint_hdl, "mbrt")->ToObject();
     rdman = xnjsmb_rt_rdman(rt);
     
-    rdman_paint_free(rdman, paint);
+    r = rdman_paint_free(rdman, paint);
+    ASSERT(r == 0);
     
     paint_hdl->Dispose();
     delete paint_hdl;
--- a/src/redraw_man.c	Sun Aug 29 18:48:20 2010 +0800
+++ b/src/redraw_man.c	Sun Aug 29 19:06:24 2010 +0800
@@ -889,7 +889,7 @@
     shape_t *shape;
 
     if(rdman_is_dirty(rdman)) {
-	if(!(paint->flags & PNTF_FREE))
+	if(paint->flags & PNTF_FREE)
 	    return ERR;
 	add_free_obj(rdman, paint, (free_func_t)rdman_paint_free);
 	paint->flags |= PNTF_FREE;