You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2008/11/06 14:30:44 UTC
svn commit: r711855 - in /incubator/qpid/trunk/qpid/cpp/src/qpid:
broker/Connection.cpp sys/AggregateOutput.cpp sys/AggregateOutput.h
Author: gsim
Date: Thu Nov 6 05:30:27 2008
New Revision: 711855
URL: http://svn.apache.org/viewvc?rev=711855&view=rev
Log:
QPID-1417: ensure there are no dangling pointers in a connections output tasks
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=711855&r1=711854&r2=711855&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Thu Nov 6 05:30:27 2008
@@ -169,6 +169,8 @@
{
QPID_LOG_IF(error, code != 200, "Connection " << mgmtId << " closed by error: " << text << "(" << code << ")");
adapter.close(code, text, classId, methodId);
+ //make sure we delete dangling pointers from outputTasks before deleting sessions
+ outputTasks.removeAll();
channels.clear();
getOutput().close();
}
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp?rev=711855&r1=711854&r2=711855&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp Thu Nov 6 05:30:27 2008
@@ -65,4 +65,9 @@
if (i != tasks.end()) tasks.erase(i);
}
+void AggregateOutput::removeAll()
+{
+ tasks.clear();
+}
+
}} // namespace qpid::sys
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h?rev=711855&r1=711854&r2=711855&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h Thu Nov 6 05:30:27 2008
@@ -48,6 +48,7 @@
bool hasOutput();
void addOutputTask(OutputTask* t);
void removeOutputTask(OutputTask* t);
+ void removeAll();
/** Apply f to each OutputTask* in the tasks list */
template <class F> void eachOutput(F f) {