Fix of recent GCode / GCodeProcessor refactoring: Don't close a FILE
twice.
This commit is contained in:
parent
152e236dda
commit
0da0a7b2a0
2 changed files with 23 additions and 4 deletions
src/libslic3r/GCode
|
@ -350,7 +350,12 @@ void GCodeProcessor::TimeProcessor::reset()
|
|||
struct FilePtr {
|
||||
FilePtr(FILE *f) : f(f) {}
|
||||
~FilePtr() { this->close(); }
|
||||
void close() { if (f) ::fclose(f); }
|
||||
void close() {
|
||||
if (this->f) {
|
||||
::fclose(this->f);
|
||||
this->f = nullptr;
|
||||
}
|
||||
}
|
||||
FILE* f = nullptr;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue