godot/core
Pedro J. Estébanez 46bfe4452f Fix object leaks caused by unfulfilled yields
Now the stack saved in a `GDScriptFunctionState` is cleared as soon as the `yield()` operation is known not to be resumed because either the script, the instance or both are deleted.

This clears problems like leaked objects by eliminating cases of circular references between `GDScriptFunctionState`s preventing them and the objects they refer to in their saved stacks from being released. As an example, this makes using `SceneTreeTimer` safer.

Furthermore, with this change it's now possible to print early warnings about `yield()`s to released script/instances, as now we know they won't be successfully resumed as the condition for that happens. However, this PR doesn't add such messages, to keep the observed behavior the same for the time being.

Also, now a backup of the function name in `GDScriptFunctionState` is used, since the script may not be valid by the time the function name is needed for the resume-after-yield error messages.
2020-05-05 17:54:15 +02:00
..
bind Warn when trying to open res:// or user:// with OS.shell_open() 2020-04-28 19:37:09 +02:00
crypto Exposed RenderingDevice to script API 2020-04-20 21:21:58 -03:00
debugger Rename InputFilter back to Input 2020-04-28 15:19:49 +02:00
input [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
io Remove some C++11 polyfill defines that are no longer needed 2020-05-03 00:42:04 +02:00
math Check for empty vectors before trying to access a pointer to the first 2020-05-04 21:02:58 +01:00
os Rename InputFilter back to Input 2020-04-28 15:19:49 +02:00
array.cpp Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
array.h Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
callable_method_pointer.cpp Created the callable_mp macro, for signals to call method pointers directly. 2020-02-21 13:46:45 +01:00
callable_method_pointer.h Implement decals 2020-04-14 11:13:34 -03:00
callable.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
callable.h Fix C# bindings after recent breaking changes 2020-03-17 16:30:04 +01:00
class_db.cpp Refactored shadowmapping. 2020-04-08 11:19:43 -03:00
class_db.h Refactored shadowmapping. 2020-04-08 11:19:43 -03:00
color_names.inc doc: Document named color constants 2020-01-26 12:08:16 +01:00
color.cpp Remove deprecated Color::gray 2020-02-12 11:22:33 +01:00
color.h [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
command_queue_mt.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
command_queue_mt.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
compressed_translation.cpp Style: Set clang-format Standard to Cpp11 2020-03-17 07:36:24 +01:00
compressed_translation.h PoolVector is gone, replaced by Vector 2020-02-18 10:10:36 +01:00
container_type_validate.h Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
core_builders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
core_string_names.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
core_string_names.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
cowdata.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
dictionary.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
dictionary.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
engine.cpp Fix Engine get_target_fps() returning float instead of int. 2020-04-10 06:48:22 +01:00
engine.h Fix Engine get_target_fps() returning float instead of int. 2020-04-10 06:48:22 +01:00
error_list.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
error_macros.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
error_macros.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
func_ref.cpp Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
func_ref.h Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
global_constants.cpp Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor 2020-04-20 17:13:06 +02:00
global_constants.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
hash_map.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
hashfuncs.h Implement decals 2020-04-14 11:13:34 -03:00
image.cpp Fix square image resize 2020-04-18 13:29:01 +03:00
image.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
int_types.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
list.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
make_binders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
map.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
message_queue.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
message_queue.h Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
method_bind.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
method_bind.h Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
method_ptrcall.h Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
node_path.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
node_path.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
oa_hash_map.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
object_id.h Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
object.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
object.h Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
ordered_hash_map.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
packed_data_container.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
packed_data_container.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
pair.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
path_remap.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
path_remap.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
pool_allocator.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
pool_allocator.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
print_string.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
print_string.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
project_settings.cpp Priorize Embedded PCKs on loading 2020-05-04 15:24:25 +02:00
project_settings.h Revert "Made possible to specify where to dump the contents when loading a ".pck" file" 2020-04-20 10:57:05 +02:00
reference.cpp Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
reference.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
register_core_types.cpp Rename InputFilter back to Input 2020-04-28 15:19:49 +02:00
register_core_types.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
resource.cpp Fixes leaks in ResourceCache, Vulkan and X11 2020-04-15 10:27:57 +02:00
resource.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
rid_owner.cpp Vulkan: Move thirdparty code out of drivers, style fixes 2020-02-11 14:08:44 +01:00
rid_owner.h Implement decals 2020-04-14 11:13:34 -03:00
rid.h Implement decals 2020-04-14 11:13:34 -03:00
ring_buffer.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
safe_refcount.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
safe_refcount.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
script_language.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
script_language.h Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
self_list.h Fix object leaks caused by unfulfilled yields 2020-05-05 17:54:15 +02:00
set.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
simple_type.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
sort_array.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
spin_lock.h Vulkan: Move thirdparty code out of drivers, style fixes 2020-02-11 14:08:44 +01:00
string_buffer.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
string_builder.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
string_builder.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
string_name.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
string_name.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
thread_work_pool.cpp Vulkan: Move thirdparty code out of drivers, style fixes 2020-02-11 14:08:44 +01:00
thread_work_pool.h Fixes some memory leaks 2020-02-13 09:46:13 +08:00
translation.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
translation.h i18n: Add support for translating the class reference 2020-03-20 08:48:11 +01:00
type_info.h Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
typed_array.cpp Add ability to bind typed arrays to script API 2020-04-21 10:15:40 +02:00
typed_array.h Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
typedefs.h typedefs: Cleanup unused macros and unnecessary checks 2020-03-11 21:44:56 +01:00
ucaps.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
undo_redo.cpp Replace is_commiting_action with is_committing_action 2020-04-08 18:52:04 +02:00
undo_redo.h Added StringName as a variant type. 2020-02-21 14:25:29 +01:00
ustring.cpp Improve the shader error console output 2020-04-04 14:27:44 +02:00
ustring.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
variant_call.cpp [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
variant_op.cpp [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
variant_parser.cpp Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
variant_parser.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
variant.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
variant.h Remove some C++11 polyfill defines that are no longer needed 2020-05-03 00:42:04 +02:00
vector.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
version.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
vmap.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
vset.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00