Merge branch 'patch/JAL-4298_synchronize_consoledoc' into bug/JAL-4298_java_console_c...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 19 Oct 2023 20:06:00 +0000 (21:06 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 19 Oct 2023 20:06:00 +0000 (21:06 +0100)
1  2 
src/jalview/gui/Console.java

@@@ -713,12 -683,16 +713,16 @@@ public class Console extends WindowAdap
                displayPipe = tmp;
              }
              // simply append whole buffer
-             textArea.append(replace.toString()); // ##### implicated BLOCKED
-             count += replace.length();
-             if (count > byteslim)
+             synchronized (textArea.getDocument())
              {
-               trimBuffer(false);
+               textArea.append(replace.toString());
+               count += replace.length();
+               if (count > byteslim)
+               {
+                 trimBuffer(false);
+               }
              }
 -            
++
            }
            if (displayPipe.length() == 0)
            {