diff options
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 4 | ||||
-rw-r--r-- | scene/2d/line_builder.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index eb186a8e1f..39d3f2d6bf 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -246,12 +246,14 @@ void AudioStreamPlayer2D::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> AudioStreamPlayer2D::get_stream() const { diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 9eea5191b9..1235013af4 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -139,7 +139,7 @@ void LineBuilder::build() { float current_distance0 = 0.f; float current_distance1 = 0.f; - float total_distance; + float total_distance = 0.f; _interpolate_color = gradient != NULL; bool distance_required = _interpolate_color || texture_mode == LINE_TEXTURE_TILE; if (distance_required) |