reduce the risk of abort
[booh] / bin / booh
index 779abdb64d588646fc88ccff88d0353a66489725..7bcc6a4746919f80458311e816177f3faf5d281b 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -3885,10 +3885,15 @@ def create_main_window
     $protect_gtk_pending_calls = Mutex.new
     $gtk_pending_calls = []
     Gtk.timeout_add(100) {
-        $protect_gtk_pending_calls.synchronize {
-            $gtk_pending_calls.each { |c| c.call }
-            $gtk_pending_calls = []
-        }
+        empty = nil
+        begin
+            $protect_gtk_pending_calls.synchronize {
+                if ! $gtk_pending_calls.empty?
+                    $gtk_pending_calls.pop.call
+                end
+                empty = $gtk_pending_calls.empty?
+            }
+        end while ! empty
         true
     }