Skip to content

Commit

Permalink
PooledFile close
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Oct 29, 2023
1 parent cd0f6e5 commit 821d869
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/eckit/io/PooledFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ class PoolFileEntry {

void remove(const PooledFile* file) {
auto s = statuses_.find(file);
ASSERT(s != statuses_.end());

statuses_.erase(s);

if (s != statuses_.end()) {
statuses_.erase(s);
}
if (statuses_.size() == 0) {
doClose();
pool_.erase(name_);
Expand Down Expand Up @@ -114,10 +113,10 @@ class PoolFileEntry {

void close(const PooledFile* file) {
auto s = statuses_.find(file);
ASSERT(s != statuses_.end());

ASSERT(s->second.opened_);
s->second.opened_ = false;
if (s != statuses_.end()) {
ASSERT(s->second.opened_);
s->second.opened_ = false;
}
}

int fileno(const PooledFile* file) const {
Expand Down

0 comments on commit 821d869

Please sign in to comment.