diff --git a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java index db1dd13..c2dea73 100644 --- a/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java +++ b/ice-adapter/src/main/java/com/faforever/iceadapter/ice/PeerIceModule.java @@ -91,6 +91,10 @@ synchronized void initiateIce() { * Creates an agent and media stream for handling the ICE */ private void createAgent() { + if(agent != null) { + agent.free(); + } + agent = new Agent(); agent.setControlling(peer.isLocalOffer());