Remove warnings about benign situations

This commit is contained in:
Pedro J. Estébanez 2017-07-10 16:17:09 +02:00
parent 171d8a501f
commit 73fb33a931
2 changed files with 13 additions and 4 deletions

View File

@ -329,7 +329,10 @@ void Area2D::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_CONTINUE(!node);
if (!node) //node may have been deleted in previous frame or at other legiminate point
continue;
//ERR_CONTINUE(!node);
node->disconnect(SceneStringNames::get_singleton()->enter_tree, this, SceneStringNames::get_singleton()->_body_enter_tree);
node->disconnect(SceneStringNames::get_singleton()->exit_tree, this, SceneStringNames::get_singleton()->_body_exit_tree);
@ -357,7 +360,7 @@ void Area2D::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
if (!node) //node may have been deleted in previous frame, this should not be an error
if (!node) //node may have been deleted in previous frame or at other legiminate point
continue;
//ERR_CONTINUE(!node);

View File

@ -227,7 +227,10 @@ void Area::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_CONTINUE(!node);
if (!node) //node may have been deleted in previous frame or at other legiminate point
continue;
//ERR_CONTINUE(!node);
node->disconnect(SceneStringNames::get_singleton()->enter_tree, this, SceneStringNames::get_singleton()->_body_enter_tree);
node->disconnect(SceneStringNames::get_singleton()->exit_tree, this, SceneStringNames::get_singleton()->_body_exit_tree);
@ -254,7 +257,10 @@ void Area::_clear_monitoring() {
Object *obj = ObjectDB::get_instance(E->key());
Node *node = obj ? obj->cast_to<Node>() : NULL;
ERR_CONTINUE(!node);
if (!node) //node may have been deleted in previous frame or at other legiminate point
continue;
//ERR_CONTINUE(!node);
node->disconnect(SceneStringNames::get_singleton()->enter_tree, this, SceneStringNames::get_singleton()->_area_enter_tree);
node->disconnect(SceneStringNames::get_singleton()->exit_tree, this, SceneStringNames::get_singleton()->_area_exit_tree);