1. Jay Roberts
  2. love

Commits

rude  committed 0758bba

Apply Boolsheet's GME leak patch.

  • Participants
  • Parent commits d5eacd6
  • Branches default

Comments (0)

Files changed (1)

File src/modules/sound/lullaby/GmeDecoder.cpp

View file
 
 	num_tracks = gme_track_count(emu);
 
-	if (num_tracks <= 0)
-		throw love::Exception("Game music file has no tracks");
+	try
+	{
+		if (num_tracks <= 0)
+			throw love::Exception("Game music file has no tracks");
 
-	if (gme_start_track(emu, cur_track) != 0)
-		throw love::Exception("Could not start game music playback");
+		if (gme_start_track(emu, cur_track) != 0)
+			throw love::Exception("Could not start game music playback");
+	}
+	catch (love::Exception &)
+	{
+		gme_delete(emu);
+		throw;
+	}
 }
 
 GmeDecoder::~GmeDecoder()