Shut down STUN stack before removing streams from Agent. (#202)

Should fix NPEs being thrown during Agent.free().
This commit is contained in:
Jonathan Lennox 2020-04-21 09:59:33 -04:00 committed by GitHub
parent e6e36856c6
commit 7016902b21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2382,6 +2382,9 @@ public class Agent
terminate(IceProcessingState.TERMINATED);
}
/* Stop all outstanding transactions */
getStunStack().shutDown();
// Free its IceMediaStreams, Components and Candidates.
boolean interrupted = false;
@ -2406,8 +2409,6 @@ public class Agent
if (interrupted)
Thread.currentThread().interrupt();
getStunStack().shutDown();
logger.debug(() -> "ICE agent freed");
}