summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-09-01 16:42:50 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-09-01 16:43:46 -0300
commit42659b0d9f29967a89d5055f23decacb81018509 (patch)
tree499d320be26d3d068de079c79b188326e6884741 /scene/3d
parent3694c58d3cb9f2af41a8f964e00712bb5578af76 (diff)
Fix freeze on exit on audiostreamplayers when setting invalid stream, closes #10093
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 6efdf25f0d..1ad36102ba 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -555,12 +555,12 @@ void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) {
stream = p_stream;
stream_playback = p_stream->instance_playback();
+ AudioServer::get_singleton()->unlock();
+
if (stream_playback.is_null()) {
stream.unref();
ERR_FAIL_COND(stream_playback.is_null());
}
-
- AudioServer::get_singleton()->unlock();
}
Ref<AudioStream> AudioStreamPlayer3D::get_stream() const {