From 3c67e22c3d0028df31e060ea28fb9f96b9f65cdf Mon Sep 17 00:00:00 2001 From: yg2f Date: Sat, 28 Mar 2015 18:34:28 +0100 Subject: add : bool Object.is_queued_for_deletion() `object.is_queued_for_deletion()` return true if the object was `object.queue_free()` or `SceneTree.queue_delete(object)`. --- scene/main/scene_main_loop.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/main') diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index ed3e419359..8e2dc93288 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -850,6 +850,7 @@ void SceneTree::queue_delete(Object *p_object) { _THREAD_SAFE_METHOD_ ERR_FAIL_NULL(p_object); + p_object->_is_queued_for_deletion = true; delete_queue.push_back(p_object->get_instance_ID()); } -- cgit v1.2.3 From 68c2a959dd8516823f9f501bed1ac23197e892d2 Mon Sep 17 00:00:00 2001 From: TheoXD Date: Fri, 3 Apr 2015 14:42:05 +0200 Subject: Bullet shower demo crashed because of dynamic casting in the code for object picking. Making sure the object has an ID greater than 0 before typecasting solves it. --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ee400ae6d5..f0c71da153 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -406,7 +406,7 @@ void Viewport::_notification(int p_what) { int rc = ss2d->intersect_point(point,res,64,Set(),0xFFFFFFFF,0xFFFFFFFF); for(int i=0;icast_to(); if (co) { -- cgit v1.2.3 From e7ba4eca9f7ea767d75db8ecc2d73c1e7c217b7e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 9 Apr 2015 00:49:48 -0300 Subject: -function remove_and_delete_child removed. Just use child.free() or child.queue_free() instead. Fixes #1603 --- scene/main/node.cpp | 5 +++-- scene/main/node.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'scene/main') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index fbdc87a7cc..145ce22453 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -295,7 +295,7 @@ void Node::add_child_notify(Node *p_child) { // to be used when not wanted } - +/* void Node::remove_and_delete_child(Node *p_child) { ERR_FAIL_NULL( p_child ); @@ -305,6 +305,7 @@ void Node::remove_and_delete_child(Node *p_child) { memdelete(p_child); } +*/ void Node::remove_child_notify(Node *p_child) { @@ -1763,7 +1764,7 @@ void Node::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_name"),&Node::get_name); ObjectTypeDB::bind_method(_MD("add_child","node:Node"),&Node::add_child); ObjectTypeDB::bind_method(_MD("remove_child","node:Node"),&Node::remove_child); - ObjectTypeDB::bind_method(_MD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); + //ObjectTypeDB::bind_method(_MD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); ObjectTypeDB::bind_method(_MD("get_child_count"),&Node::get_child_count); ObjectTypeDB::bind_method(_MD("get_children"),&Node::_get_children); ObjectTypeDB::bind_method(_MD("get_child:Node","idx"),&Node::get_child); diff --git a/scene/main/node.h b/scene/main/node.h index 47f49eb625..175c9a1a37 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -143,7 +143,7 @@ protected: virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); virtual void move_child_notify(Node *p_child); - void remove_and_delete_child(Node *p_child); + //void remove_and_delete_child(Node *p_child); void _propagate_replace_owner(Node *p_owner,Node* p_by_owner); -- cgit v1.2.3 From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- scene/main/canvas_layer.cpp | 2 +- scene/main/canvas_layer.h | 2 +- scene/main/misc.cpp | 2 +- scene/main/misc.h | 2 +- scene/main/node.cpp | 2 +- scene/main/node.h | 2 +- scene/main/resource_preloader.cpp | 2 +- scene/main/resource_preloader.h | 2 +- scene/main/scene_main_loop.cpp | 2 +- scene/main/scene_main_loop.h | 2 +- scene/main/scene_singleton.cpp | 2 +- scene/main/scene_singleton.h | 2 +- scene/main/timer.cpp | 2 +- scene/main/timer.h | 2 +- scene/main/viewport.cpp | 2 +- scene/main/viewport.h | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) (limited to 'scene/main') diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index ae842577a9..ee3d7f5afd 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index 638f3ec579..edd00c1a7a 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.cpp b/scene/main/misc.cpp index 761f470c11..108621baa5 100644 --- a/scene/main/misc.cpp +++ b/scene/main/misc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.h b/scene/main/misc.h index 34b80a08b4..e7894aa68d 100644 --- a/scene/main/misc.h +++ b/scene/main/misc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 145ce22453..e0181b9238 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/node.h b/scene/main/node.h index 175c9a1a37..aeada3c5bb 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 8227046ecb..f49f626e78 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index e1e3beb0b3..b3e7496fb7 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index 8e2dc93288..9f2fadcb4d 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 31a823ab1a..fec4dd3908 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_singleton.cpp b/scene/main/scene_singleton.cpp index 042164a1f3..69eb6e24d9 100644 --- a/scene/main/scene_singleton.cpp +++ b/scene/main/scene_singleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_singleton.h b/scene/main/scene_singleton.h index 1e0359fe91..25157a26ac 100644 --- a/scene/main/scene_singleton.h +++ b/scene/main/scene_singleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index f718a09577..e59fd6fb75 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.h b/scene/main/timer.h index b89cd10664..021638ccfc 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index f0c71da153..d3ce88e784 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 14f4f68217..fba6725610 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3 From 59154cccf9fcf814a21a2596993fb1b6777d3bb7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 20 Apr 2015 19:38:02 -0300 Subject: -Changed Godot exit to be clean. -Added more debug information on memory cleanliness on exit (if run with -v) -Fixed several memory leaks, fixes #1731, fixes #755 --- scene/main/viewport.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d3ce88e784..4d9feb3af1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1450,6 +1450,7 @@ Viewport::~Viewport() { VisualServer::get_singleton()->free( viewport ); SpatialSoundServer::get_singleton()->free(listener); + SpatialSound2DServer::get_singleton()->free(listener_2d); if (render_target_texture.is_valid()) render_target_texture->vp=NULL; //so if used, will crash } -- cgit v1.2.3 From bf53b7789a3de5d7f7e82b30c87b59544b900c1f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 1 May 2015 11:44:02 -0300 Subject: -fix timer behavior described, closes #1455 --- scene/main/timer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/main') diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index e59fd6fb75..2e3e7db0ad 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -46,6 +46,8 @@ void Timer::_notification(int p_what) { } break; case NOTIFICATION_PROCESS: { + if (!is_processing()) + return; time_left -= get_process_delta_time(); if (time_left<0) { -- cgit v1.2.3