summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2021-08-23 20:36:48 -0300
committerGitHub <noreply@github.com>2021-08-23 20:36:48 -0300
commitaa3c3a9ebbc096bba9eda324b91acbb7f14a7b07 (patch)
tree5db9dc95f2d2d552a52349bd22578032727d682d /scene/2d
parent0df9895eb755dba7ec9bd764c36fa873175bc256 (diff)
parent44d62a9f4b6ac892b1fb9b8998be4162409952e3 (diff)
Merge pull request #52036 from reduz/native-extension-argument-pointers
Implement NativeExtension pointer arguments
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/audio_stream_player_2d.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index e0b994f27d..8a4d42fd1f 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -272,8 +272,12 @@ void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) {
}
if (p_stream.is_valid()) {
- stream = p_stream;
stream_playback = p_stream->instance_playback();
+ if (stream_playback.is_valid()) {
+ stream = p_stream;
+ } else {
+ stream.unref();
+ }
}
AudioServer::get_singleton()->unlock();