Merge pull request #313 from MilosKozak/synchronize-nsclientlog

synchronize NSClient log
This commit is contained in:
Milos Kozak 2017-07-25 12:50:48 +02:00 committed by GitHub
commit 252b24cefe

View file

@ -159,7 +159,7 @@ public class NSClientInternalPlugin implements PluginBase {
MainApp.bus().post(new EventNSClientUpdateGUI()); MainApp.bus().post(new EventNSClientUpdateGUI());
} }
void clearLog() { synchronized void clearLog() {
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { 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() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -183,7 +183,7 @@ public class NSClientInternalPlugin implements PluginBase {
}); });
} }
static void updateLog() { static synchronized void updateLog() {
try { try {
StringBuilder newTextLog = new StringBuilder(); StringBuilder newTextLog = new StringBuilder();
List<EventNSClientNewLog> temporaryList = new ArrayList<>(listLog); List<EventNSClientNewLog> temporaryList = new ArrayList<>(listLog);