godot/scene/audio
Lyuma c088a2dd89 Fix crash due to reentrancy in AudioStreamPlayer* finished signal.
This crash occurred when an audio stream finished playing in NOTIFICATION_INTERNAL_PROCESS,
during which it would iterate through a loop of playbacks,
leading to a "finished" signal, which removed the audio player from the tree
which led to a NOTIFICATION_EXIT_TREE,
which would mutate the array of playbacks while within the above loop.

This moves the signal callback outside of the loop which avoids the crash.
Note: previously, the signal was called multiple times if the same player finishes multiple times in one frame. Now it is at most once per frame.

Affects AudioStreamPlayer, AudioStreamPlayer2D and AudioStreamPlayer3D
2021-10-28 19:45:29 -07:00
..
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
audio_stream_player.cpp Fix crash due to reentrancy in AudioStreamPlayer* finished signal. 2021-10-28 19:45:29 -07:00
audio_stream_player.h Add polyphony to Audio Stream Player nodes 2021-09-07 09:44:39 -07:00