From 3b05d2c9895b25816c57ea0de6b9dbbee2f7305e Mon Sep 17 00:00:00 2001 From: Mark Kuo Date: Sun, 28 Jun 2020 10:20:07 +1000 Subject: [PATCH] VideoStreamGDNative: close file in cleanup We should close the file handle when we are done. --- modules/gdnative/videodecoder/video_stream_gdnative.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 9d9c5b6473..fe7c10cad9 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/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;