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

trying to fix weird race condition on windows causing the solver window to...

trying to fix weird race condition on windows causing the solver window to close when closing the message window
parent bc10926b
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,6 @@ void solver_cb(Fl_Widget *w, void *data) ...@@ -32,7 +32,6 @@ void solver_cb(Fl_Widget *w, void *data)
first[i] = 1; first[i] = 1;
init = 1; init = 1;
} }
if(first[num]) { if(first[num]) {
first[num] = 0; first[num] = 0;
char file[256], no_ext[256], ext[256], base[256]; char file[256], no_ext[256], ext[256], base[256];
...@@ -41,6 +40,11 @@ void solver_cb(Fl_Widget *w, void *data) ...@@ -41,6 +40,11 @@ void solver_cb(Fl_Widget *w, void *data)
strcat(file, SINFO[num].extension.c_str()); strcat(file, SINFO[num].extension.c_str());
GUI::instance()->solver[num]->input[0]->value(file); GUI::instance()->solver[num]->input[0]->value(file);
} }
// show the window before calling Solver() to avoid race condition on
// Windows (if the message window pops up die to an error, the window
// callbacks get messed up)
GUI::instance()->solver[num]->win->show();
if(SINFO[num].nboptions) { if(SINFO[num].nboptions) {
std::string file = FixWindowsPath std::string file = FixWindowsPath
(GUI::instance()->solver[num]->input[0]->value()); (GUI::instance()->solver[num]->input[0]->value());
...@@ -50,7 +54,6 @@ void solver_cb(Fl_Widget *w, void *data) ...@@ -50,7 +54,6 @@ void solver_cb(Fl_Widget *w, void *data)
sprintf(tmp, "%s %s", SINFO[num].option_command.c_str(), tmp2); sprintf(tmp, "%s %s", SINFO[num].option_command.c_str(), tmp2);
Solver(num, tmp); Solver(num, tmp);
} }
GUI::instance()->solver[num]->win->show();
} }
static void solver_file_open_cb(Fl_Widget *w, void *data) static void solver_file_open_cb(Fl_Widget *w, void *data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment