From 64fed078093004669aaa66c49bd0921ba3a0ce96 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sun, 3 Nov 2024 23:11:44 +0100 Subject: [PATCH] [Editor] Move thread name assignment in audio preview This method is not an instance method so cannot be used this way, it instead sets the name of the *calling* thread. Putting it in the thread function makes it work correctly. --- editor/audio_stream_preview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index 8dd4820c4e9..eae31d1aa80 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -109,6 +109,8 @@ void AudioStreamPreviewGenerator::_update_emit(ObjectID p_id) { } void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) { + Thread::set_name("AudioStreamPreviewGenerator"); + Preview *preview = static_cast(p_preview); float muxbuff_chunk_s = 0.25; @@ -208,7 +210,6 @@ Ref AudioStreamPreviewGenerator::generate_preview(const Ref< if (preview->playback.is_valid()) { preview->thread = memnew(Thread); - preview->thread->set_name("AudioStreamPreviewGenerator"); preview->thread->start(_preview_thread, preview); }