Merge pull request #116299 from ExpiredPopsicle/fix_mic_input_crash
Fix `AudioStreamPlaybackMicrophone` shutdown crash
This commit is contained in:
commit
8db94f7b5e
2 changed files with 11 additions and 0 deletions
|
|
@ -1608,6 +1608,11 @@ void AudioServer::update() {
|
|||
for (CallbackItem *ci : update_callback_list) {
|
||||
ci->callback(ci->userdata);
|
||||
}
|
||||
|
||||
_cleanup_lists();
|
||||
}
|
||||
|
||||
void AudioServer::_cleanup_lists() {
|
||||
mix_callback_list.maybe_cleanup();
|
||||
update_callback_list.maybe_cleanup();
|
||||
listener_changed_callback_list.maybe_cleanup();
|
||||
|
|
@ -2124,6 +2129,10 @@ AudioServer::AudioServer() {
|
|||
}
|
||||
|
||||
AudioServer::~AudioServer() {
|
||||
// Cleanup resources while we still have an active AudioServer singleton,
|
||||
// for resources that depend on the singleton still existing.
|
||||
_cleanup_lists();
|
||||
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -315,6 +315,8 @@ private:
|
|||
void _delete_stream_playback(Ref<AudioStreamPlayback> p_playback);
|
||||
void _delete_stream_playback_list_node(AudioStreamPlaybackListNode *p_node);
|
||||
|
||||
void _cleanup_lists();
|
||||
|
||||
// TODO document if this is necessary.
|
||||
SafeList<AudioStreamPlaybackBusDetails *> bus_details_graveyard_frame_old;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue