From 34e53576e195858c95affebcd84d11fc0f384a6c Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 15 Nov 2013 15:31:38 +0100 Subject: [PATCH] Trying to fix a concurrency exception --- src/main/java/org/kde/kdeconnect/Device.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kde/kdeconnect/Device.java b/src/main/java/org/kde/kdeconnect/Device.java index 269e9427..1e4cc57c 100644 --- a/src/main/java/org/kde/kdeconnect/Device.java +++ b/src/main/java/org/kde/kdeconnect/Device.java @@ -529,7 +529,7 @@ public class Device implements BaseLink.PackageReceiver { return plugins.get(name); } - private void addPlugin(final String name) { + private synchronized void addPlugin(final String name) { Plugin existing = plugins.get(name); if (existing != null) { Log.w("addPlugin","plugin already present:" + name); @@ -575,7 +575,7 @@ public class Device implements BaseLink.PackageReceiver { } - private boolean removePlugin(String name) { + private synchronized boolean removePlugin(String name) { Plugin plugin = plugins.remove(name); Plugin failedPlugin = failedPlugins.remove(name);