From c04a9ff75128aed07a408c7c6bc9d4027d716bd3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 20 Feb 2016 20:59:02 -0300 Subject: -Fixed bug with event player crashing, closes #3687 --- scene/audio/event_player.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/audio/event_player.cpp') diff --git a/scene/audio/event_player.cpp b/scene/audio/event_player.cpp index eabe84a8ee..f43c3c2a59 100644 --- a/scene/audio/event_player.cpp +++ b/scene/audio/event_player.cpp @@ -54,6 +54,8 @@ void EventPlayer::set_stream(const Ref &p_stream) { stream=p_stream; if (stream.is_valid()) playback=stream->instance_playback(); + else + playback.unref(); if (playback.is_valid()) { -- cgit v1.2.3