changeset 1406:88c8c874f4b8

Check if the js object has been deleted. This prevent the issue that a coord is removed twice.
author wycc
date Tue, 05 Apr 2011 10:23:30 +0800
parents 05e8d3ffa703
children f19121bd6a6c
files nodejs/coord.cc
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/coord.cc	Mon Apr 04 11:59:19 2011 +0800
+++ b/nodejs/coord.cc	Tue Apr 05 10:23:30 2011 +0800
@@ -81,6 +81,7 @@
     FOR_COORDS_PREORDER(coord, child) {
 	child_hdl = (Persistent<Object> *)mb_prop_get(&child->obj.props,
 						      PROP_JSOBJ);
+	if (child_hdl == NULL) continue;
 	SET(*child_hdl, "valid", _false);
 	WRAP(*child_hdl, NULL);
 	child_hdl->Dispose();
@@ -90,6 +91,7 @@
 	FOR_COORD_SHAPES(child, mem) {
 	    mem_hdl = (Persistent<Object> *)mb_prop_get(&mem->obj.props,
 							PROP_JSOBJ);
+	    if (mem_hdl == NULL) continue;							
 	    SET(*mem_hdl, "valid", _false);
 	    WRAP(*mem_hdl, NULL);
 	    mem_hdl->Dispose();