Mercurial > MadButterfly
diff nodejs/coord.cc @ 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 | be0e02948c1d |
children | 61c217f8cec8 |
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"); }