Browse Source

VideoStreamGDNative: close file in cleanup

We should close the file handle when we are done.
Mark Kuo 5 years ago
parent
commit
3b05d2c989
1 changed files with 5 additions and 0 deletions
  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) {
 	if (pcm) {
 		memfree(pcm);
 		memfree(pcm);
 	}
 	}
+	if (file) {
+		file->close();
+		memdelete(file);
+		file = nullptr;
+	}
 	pcm = nullptr;
 	pcm = nullptr;
 	time = 0;
 	time = 0;
 	num_channels = -1;
 	num_channels = -1;