Call DoEvents during time-consuming operations
[xboard.git] / backend.c
index f3f86c6..36eca33 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -8371,10 +8371,10 @@ BitbaseProbe ()
     // probe EGBB
     if(loaded == 2) return 13; // loading failed before
     if(loaded == 0) {
-       loaded = 2; // prepare for failure
        char *p, *path = strstr(appData.egtFormats, "scorpio:"), buf[MSG_SIZ];
        HMODULE lib;
        PLOAD_EGBB loadBB;
+       loaded = 2; // prepare for failure
        if(!path) return 13; // no egbb installed
        strncpy(buf, path + 8, MSG_SIZ);
        if(p = strchr(buf, ',')) *p = NULLCHAR; else p = buf + strlen(buf);
@@ -15851,7 +15851,7 @@ SaveSelected (FILE *g, int dummy, char *dummy2)
        if(lg->position >= 0) { // selected?
            LoadGame(f, nItem, "", TRUE);
            SaveGamePGN2(g); // leaves g open
-           cnt++;
+           cnt++; DoEvents();
        }
         lg = (ListGame *) lg->node.succ;
     }
@@ -15887,8 +15887,11 @@ CreateBookEvent ()
 
     /* Get list size */
     for (nItem = 1; nItem <= ((ListGame *) gameList.tailPred)->number; nItem++){
-       LoadGame(f, nItem, "", TRUE);
-       AddGameToBook(TRUE);
+       if(lg->position >= 0) {
+           LoadGame(f, nItem, "", TRUE);
+           AddGameToBook(TRUE);
+           DoEvents();
+       }
         lg = (ListGame *) lg->node.succ;
     }