diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index b6fb81c47..d07098a2a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -977,7 +977,6 @@ public final class SWF implements SWFContainerItem, Timelined { }; int currentIndex = index.getAndIncrement(); synchronized (ABC.class) { - long time = stopTime - startTime; informListeners("exporting", "Exporting script " + currentIndex + "/" + count + " " + path); } new RetryTask(rio, handler).run(); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java index 973d18ffa..06fbc4a71 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java @@ -36,32 +36,36 @@ import jsyntaxpane.SyntaxDocument; */ public class UndoFixedEditorPane extends JEditorPane { + private static final Object setTextLock = new Object(); + @Override public void setText(String t) { setText(t, getContentType()); } - public synchronized void setText(String t, String contentType) { - if (!t.equals(getText())) { - boolean plain = t.length() > Configuration.syntaxHighlightLimit.get(); - if (plain) { - contentType = "text/plain"; + public void setText(String t, String contentType) { + synchronized (setTextLock) { + if (!t.equals(getText())) { + boolean plain = t.length() > Configuration.syntaxHighlightLimit.get(); + if (plain) { + contentType = "text/plain"; + } + + try { + setContentType(contentType); + Document doc = getDocument(); + setDocument(new SyntaxDocument(null)); + doc.remove(0, doc.getLength()); + Reader r = new StringReader(t); + EditorKit kit = createEditorKitForContentType(contentType); + kit.read(r, doc, 0); + setDocument(doc); + } catch (BadLocationException | IOException ex) { + Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.SEVERE, null, ex); + } + + clearUndos(); } - - try { - setContentType(contentType); - Document doc = getDocument(); - setDocument(new SyntaxDocument(null)); - doc.remove(0, doc.getLength()); - Reader r = new StringReader(t); - EditorKit kit = createEditorKitForContentType(contentType); - kit.read(r, doc, 0); - setDocument(doc); - } catch (BadLocationException | IOException ex) { - Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.SEVERE, null, ex); - } - - clearUndos(); } }