mirror of https://github.com/vitalif/openscad
Close file as soon as possible to avoid potential readlocks being kept too long. Might be enough for #415
parent
2da488800c
commit
ec867349ff
|
@ -74,13 +74,15 @@ FileModule *ModuleCache::evaluate(const std::string &filename)
|
|||
}
|
||||
#endif
|
||||
|
||||
std::ifstream ifs(filename.c_str());
|
||||
if (!ifs.is_open()) {
|
||||
PRINTB("WARNING: Can't open library file '%s'\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
std::stringstream textbuf;
|
||||
textbuf << ifs.rdbuf();
|
||||
{
|
||||
std::ifstream ifs(filename.c_str());
|
||||
if (!ifs.is_open()) {
|
||||
PRINTB("WARNING: Can't open library file '%s'\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
textbuf << ifs.rdbuf();
|
||||
}
|
||||
textbuf << "\n" << commandline_commands;
|
||||
|
||||
print_messages_push();
|
||||
|
|
Loading…
Reference in New Issue