Skip to content
Snippets Groups Projects
Commit 7b80350c authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

possible fix for "too many file descriptors" bug reported on mailing list

parent 623a7556
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ class mystreambuf: public streambuf ...@@ -41,7 +41,7 @@ class mystreambuf: public streambuf
int overflow(int ch){ int overflow(int ch){
if(index < 1023){ if(index < 1023){
txt[index] = ch; txt[index] = ch;
if(txt[index] == '\n') txt[index] = ' '; if(txt[index] == '\n' || txt[index] == '\r') txt[index] = ' ';
if(!index && txt[0] == ' '){ if(!index && txt[0] == ' '){
// skip initial spaces // skip initial spaces
} }
...@@ -59,10 +59,13 @@ void NgAddOn_Init() ...@@ -59,10 +59,13 @@ void NgAddOn_Init()
//mycout = &cout; //mycout = &cout;
//myerr = &cerr; //myerr = &cerr;
//testout = new ofstream ("test.out"); //testout = new ofstream ("test.out");
static bool first = true;
mycout = new ostream(new mystreambuf()); if(first){
myerr = new ostream(new mystreambuf()); first = false;
testout = new ofstream("/dev/null"); mycout = new ostream(new mystreambuf());
myerr = new ostream(new mystreambuf());
testout = new ofstream("/dev/null");
}
} }
// generates volume mesh from surface mesh, without optimization // generates volume mesh from surface mesh, without optimization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment