From 093bf252ede440e311619b702279df6439f4fb61 Mon Sep 17 00:00:00 2001 From: rushfan Date: Wed, 11 Sep 2019 17:42:33 -0700 Subject: [PATCH] Ensure that binkp files are closed before deleting Fixe #1193 --- networkb/wfile_transfer_file.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/networkb/wfile_transfer_file.cpp b/networkb/wfile_transfer_file.cpp index efb55e374..63814163c 100644 --- a/networkb/wfile_transfer_file.cpp +++ b/networkb/wfile_transfer_file.cpp @@ -60,6 +60,11 @@ WFileTransferFile::~WFileTransferFile() {} int WFileTransferFile::file_size() const { return file_->length(); } bool WFileTransferFile::Delete() { + // Since this file may still be open, need to ensure + // that it is closed so File::Remove will work. + if (file_->IsOpen()) { + file_->Close(); + } if (!File::Remove(file_->full_pathname())) { return false; }