summaryrefslogtreecommitdiff
path: root/scene/audio/event_player.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-02-20 20:59:02 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-02-20 21:00:08 -0300
commitc04a9ff75128aed07a408c7c6bc9d4027d716bd3 (patch)
tree9fafdff9681d0fa2828c90674ed8483bb3604e24 /scene/audio/event_player.cpp
parent1d04d55ac0fa42f889e73839d7bfaa9b389e2a14 (diff)
-Fixed bug with event player crashing, closes #3687
Diffstat (limited to 'scene/audio/event_player.cpp')
-rw-r--r--scene/audio/event_player.cpp2
1 files changed, 2 insertions, 0 deletions
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<EventStream> &p_stream) {
stream=p_stream;
if (stream.is_valid())
playback=stream->instance_playback();
+ else
+ playback.unref();
if (playback.is_valid()) {