From db3d885edacb4508ec19f0d6380b6de618cc8643 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 19 Jul 2007 16:12:22 +0000 Subject: Fix memory error that was crashing broker. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@557672 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Connection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index dfe2101bc0..978228a364 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -56,7 +56,11 @@ void Connection::received(framing::AMQFrame& frame){ if (frame.getChannel() == 0) { adapter.handle(frame); } else { - getChannel((frame.getChannel())).in->handle(frame); + // Assign handler to new shared_ptr, as it may be erased + // from the map by handle() if frame is a ChannelClose. + // + FrameHandler::Chain handler=getChannel((frame.getChannel())).in; + handler->handle(frame); } } -- cgit v1.2.1