summaryrefslogtreecommitdiff
path: root/modules/gdnative/videodecoder/video_stream_gdnative.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-28 08:59:42 +0200
committerGitHub <noreply@github.com>2020-06-28 08:59:42 +0200
commit46b36805d997b14596f5960fb5a8656f122ed24f (patch)
tree90da80b567e2209545812b0be7713e39d4a57da6 /modules/gdnative/videodecoder/video_stream_gdnative.cpp
parent27378524f20234d6f0d4c262c514101df340c3b6 (diff)
parent3b05d2c9895b25816c57ea0de6b9dbbee2f7305e (diff)
Merge pull request #39910 from starryalley/fix-videoplayer-file-close
VideoStreamGDNative: close file in cleanup()
Diffstat (limited to 'modules/gdnative/videodecoder/video_stream_gdnative.cpp')
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.cpp5
1 files changed, 5 insertions, 0 deletions
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;