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
|
@ -593,6 +593,10 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
||||||
// then we may need to call
|
// then we may need to call
|
||||||
// factory.onConnectionClose(this);
|
// factory.onConnectionClose(this);
|
||||||
sessionTaskRunner.shutdown();
|
sessionTaskRunner.shutdown();
|
||||||
|
|
||||||
|
if (asyncConnectionThread != null){
|
||||||
|
asyncConnectionThread.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
closed.set(true);
|
closed.set(true);
|
||||||
closing.set(false);
|
closing.set(false);
|
||||||
|
@ -1652,20 +1656,23 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onException(final IOException error) {
|
public void onException(final IOException error) {
|
||||||
onAsyncException(error);
|
onAsyncException(error);
|
||||||
asyncConnectionThread.execute(new Runnable() {
|
if (!closing.get() && !closed.get()) {
|
||||||
public void run() {
|
asyncConnectionThread.execute(new Runnable() {
|
||||||
transportFailed(error);
|
public void run() {
|
||||||
ServiceSupport.dispose(ActiveMQConnection.this.transport);
|
transportFailed(error);
|
||||||
brokerInfoReceived.countDown();
|
ServiceSupport.dispose(ActiveMQConnection.this.transport);
|
||||||
|
brokerInfoReceived.countDown();
|
||||||
|
|
||||||
for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
|
for (Iterator<TransportListener> iter = transportListeners
|
||||||
TransportListener listener = iter.next();
|
.iterator(); iter.hasNext();) {
|
||||||
listener.onException(error);
|
TransportListener listener = iter.next();
|
||||||
}
|
listener.onException(error);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void transportInterupted() {
|
public void transportInterupted() {
|
||||||
for (Iterator<ActiveMQSession> i = this.sessions.iterator(); i.hasNext();) {
|
for (Iterator<ActiveMQSession> i = this.sessions.iterator(); i.hasNext();) {
|
||||||
|
|
Loading…
Reference in New Issue