From 0b6c9845fadc322f675aba2bf480d414453100de Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sat, 22 Jul 2017 01:43:33 +0200 Subject: [PATCH] synchronize NSClient log --- .../plugins/NSClientInternal/NSClientInternalPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);