Skip to content

Commit

Permalink
Ensure that binkp files are closed before deleting
Browse files Browse the repository at this point in the history
Fixe #1193
  • Loading branch information
wwiv committed Sep 12, 2019
1 parent e878542 commit 093bf25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions networkb/wfile_transfer_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 093bf25

Please sign in to comment.