Commit 360e4bc1 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora
Browse files

Fix ConcurrentModificationException

When onPacketReceived was called at the same time as getSinks, because
getSinks uses .values() and onPacketReceived does .put()
parent b689548a
......@@ -30,7 +30,7 @@ import org.kde.kdeconnect_tp.R;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
public class SystemvolumePlugin extends Plugin {
......@@ -42,11 +42,11 @@ public class SystemvolumePlugin extends Plugin {
void sinksChanged();
private final HashMap<String, Sink> sinks;
private final ConcurrentHashMap<String, Sink> sinks;
private final ArrayList<SinkListener> listeners;
public SystemvolumePlugin() {
sinks = new HashMap<>();
sinks = new ConcurrentHashMap<>();
listeners = new ArrayList<>();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment