Skip to content

Commit

Permalink
Run Leelaz.parseLine at event dispatch thread
Browse files Browse the repository at this point in the history
  • Loading branch information
zakki committed Mar 20, 2021
1 parent 281db78 commit 7e92d74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/featurecat/lizzie/analysis/Leelaz.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.json.JSONException;
import org.json.JSONObject;

Expand Down Expand Up @@ -494,7 +495,8 @@ private void read() {
while ((c = inputStream.read()) != -1) {
line.append((char) c);
if ((c == '\n')) {
parseLine(line.toString());
String cmd = line.toString();
SwingUtilities.invokeLater(() -> parseLine(cmd));
line = new StringBuilder();
}
}
Expand Down

0 comments on commit 7e92d74

Please sign in to comment.