Merge pull request #110 from bgrozev/fix-leaks

Fix leaks
This commit is contained in:
Дамян Минков 2017-04-10 13:52:22 -05:00 committed by GitHub
commit 8cf47c00c2
2 changed files with 14 additions and 1 deletions

View File

@ -840,6 +840,7 @@ public class Component
getParentStream().removePairStateChangeListener(this);
keepAlivePairs.clear();
getComponentSocket().close();
socket.close();
}
/**

View File

@ -307,6 +307,11 @@ public class SinglePortUdpHarvester
synchronized (candidateSockets)
{
for (IceSocketWrapper wrapper : candidateSockets.values())
{
wrapper.close();
}
candidateSockets.clear();
}
@ -372,7 +377,14 @@ public class SinglePortUdpHarvester
// XXX is this necessary?
synchronized (candidateSockets)
{
candidateSockets.put(remoteAddress, candidateSocket);
IceSocketWrapper oldSocket
= candidateSockets.put(remoteAddress, candidateSocket);
if (oldSocket != null)
{
logger.warning("Replacing the socket for remote address "
+ remoteAddress);
oldSocket.close();
}
}
// XXX is this necessary?