浏览代码

VideoStreamGDNative: close file in cleanup

We should close the file handle when we are done.

(cherry picked from commit 3b05d2c9895b25816c57ea0de6b9dbbee2f7305e)
Mark Kuo 5 年之前
父节点
当前提交
cb9bc18102
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/gdnative/videodecoder/video_stream_gdnative.cpp

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

@@ -224,6 +224,11 @@ void VideoStreamPlaybackGDNative::cleanup() {
 		interface->destructor(data_struct);
 	if (pcm)
 		memfree(pcm);
+	if (file) {
+		file->close();
+		memdelete(file);
+		file = NULL;
+	}
 	pcm = NULL;
 	time = 0;
 	num_channels = -1;