changeset 768:13669b28826d

Fix issue of memory leaking for coord objects. When coord.cc try to release memory of coords of a subtree, a typo make the code always free root coord of the subtree. It causes a leaking.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 29 Aug 2010 17:20:13 +0800
parents 9d430b084a13
children 7c73fbc8d700
files nodejs/coord.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/coord.cc	Sun Aug 29 17:16:57 2010 +0800
+++ b/nodejs/coord.cc	Sun Aug 29 17:20:13 2010 +0800
@@ -113,7 +113,7 @@
     last_child = NULL;
     FOR_COORDS_POSTORDER(coord, child) {
 	if(last_child != NULL) {
-	    r = rdman_coord_free(rdman, coord);
+	    r = rdman_coord_free(rdman, last_child);
 	    if(r != OK)
 		THROW_noret("Unknown error");
 	}
@@ -138,7 +138,7 @@
 	last_child = child;
     }
     if(last_child != NULL) {
-	r = rdman_coord_free(rdman, coord);
+	r = rdman_coord_free(rdman, last_child);
 	if(r != OK)
 	    THROW_noret("Unknown error");
     }