diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java index 827023f5b3..b33d1cb2c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java @@ -159,7 +159,7 @@ public class NSClientInternalPlugin implements PluginBase { MainApp.bus().post(new EventNSClientUpdateGUI()); } - void clearLog() { + synchronized void clearLog() { handler.post(new Runnable() { @Override public void run() { @@ -169,7 +169,7 @@ public class NSClientInternalPlugin implements PluginBase { }); } - private void addToLog(final EventNSClientNewLog ev) { + private synchronized void addToLog(final EventNSClientNewLog ev) { handler.post(new Runnable() { @Override public void run() { @@ -183,7 +183,7 @@ public class NSClientInternalPlugin implements PluginBase { }); } - static void updateLog() { + static synchronized void updateLog() { try { StringBuilder newTextLog = new StringBuilder(); List temporaryList = new ArrayList<>(listLog);