mirror of https://github.com/apache/activemq.git
fix memory leak in ActiveMQConnection - with asyncConnectionThread not being shutdown on a close
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@581683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5bd3bf6e24
commit
08841bbde3
|
@ -594,6 +594,10 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
// factory.onConnectionClose(this);
|
||||
sessionTaskRunner.shutdown();
|
||||
|
||||
if (asyncConnectionThread != null){
|
||||
asyncConnectionThread.shutdown();
|
||||
}
|
||||
|
||||
closed.set(true);
|
||||
closing.set(false);
|
||||
}
|
||||
|
@ -1653,19 +1657,22 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
|
||||
public void onException(final IOException error) {
|
||||
onAsyncException(error);
|
||||
if (!closing.get() && !closed.get()) {
|
||||
asyncConnectionThread.execute(new Runnable() {
|
||||
public void run() {
|
||||
transportFailed(error);
|
||||
ServiceSupport.dispose(ActiveMQConnection.this.transport);
|
||||
brokerInfoReceived.countDown();
|
||||
|
||||
for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
|
||||
for (Iterator<TransportListener> iter = transportListeners
|
||||
.iterator(); iter.hasNext();) {
|
||||
TransportListener listener = iter.next();
|
||||
listener.onException(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void transportInterupted() {
|
||||
for (Iterator<ActiveMQSession> i = this.sessions.iterator(); i.hasNext();) {
|
||||
|
|
Loading…
Reference in New Issue