瀏覽代碼

Merge pull request #39910 from starryalley/fix-videoplayer-file-close

VideoStreamGDNative: close file in cleanup()
Rémi Verschelde 5 年之前
父節點
當前提交
46b36805d9
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/gdnative/videodecoder/video_stream_gdnative.cpp

+ 5 - 0
modules/gdnative/videodecoder/video_stream_gdnative.cpp

@@ -214,6 +214,11 @@ void VideoStreamPlaybackGDNative::cleanup() {
 	if (pcm) {
 		memfree(pcm);
 	}
+	if (file) {
+		file->close();
+		memdelete(file);
+		file = nullptr;
+	}
 	pcm = nullptr;
 	time = 0;
 	num_channels = -1;