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 7d45e76..e6a689f 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());