Browse Source

Stop the attached Source when a Video gets destroyed

Before it would end up paused, but this means the audio playback thread will
still keep it alive. Since there are no other references, there is no way to
then free that Source anymore.
Bart van Strien 6 years ago
parent
commit
932068e777
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/modules/graphics/Video.cpp

+ 2 - 0
src/modules/graphics/Video.cpp

@@ -96,6 +96,8 @@ Video::Video(Graphics *gfx, love::video::VideoStream *stream, float dpiscale)
 
 Video::~Video()
 {
+	if (source)
+		source->stop();
 }
 
 love::video::VideoStream *Video::getStream()