浏览代码

Merge pull request #10854 from MednauN/ogg-fix

Fix crash when destroying AudioStreamPlaybackOGGVorbis
Rémi Verschelde 8 年之前
父节点
当前提交
69ac4cbb37
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

+ 1 - 1
modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

@@ -112,8 +112,8 @@ float AudioStreamPlaybackOGGVorbis::get_length() const {
 
 AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() {
 	if (ogg_alloc.alloc_buffer) {
-		AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer);
 		stb_vorbis_close(ogg_stream);
+		AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer);
 	}
 }