diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 1 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index a672b5e14..a708f2ffb 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -238,6 +238,7 @@ extern int fl_wait(double time); // in Fl_<platform>.cxx static char in_idle; double Fl::wait(double time_to_wait) { + // delete all widgets that were listed during callbacks do_widget_deletion(); if (first_timeout) { diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 5ca8abf79..1268732c5 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -273,7 +273,12 @@ int fl_wait(double time_to_wait) { KillTimer(NULL, timerid); } } else { - have_message = GetMessage(&fl_msg, NULL, 0, 0); + // make sure that we don't lock up if there are no more windows + // that could receive messages, but still handle pending messages. + if (!Fl_X::first) + have_message = PeekMessage(&fl_msg, NULL, 0, 0, PM_REMOVE); + else + have_message = GetMessage(&fl_msg, NULL, 0, 0); } fl_lock_function(); |
