summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-05 15:26:30 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-05 15:26:30 (GMT)
commite1602cbe8c5fb1525bc66ecf5d7a939816f259c5 (patch)
tree342b54f4037063a51a0ff933dc3d52afec23bb2e /Swiften/Serializer/PayloadSerializers
parentfe24fd560ec2302306857a52a07155c93f5dde69 (diff)
downloadswift-contrib-e1602cbe8c5fb1525bc66ecf5d7a939816f259c5.zip
swift-contrib-e1602cbe8c5fb1525bc66ecf5d7a939816f259c5.tar.bz2
Fix segfaults and deadcode
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
index 023f11a..c16a2e4 100644
--- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
@@ -37,9 +37,10 @@ std::string JinglePayloadSerializer::serializePayload(boost::shared_ptr<JinglePa
jinglePayload.setAttribute("action", actionToString(payload->getAction()));
jinglePayload.setAttribute("initiator", payload->getInitiator());
jinglePayload.setAttribute("sid", payload->getSessionID());
-
- if (!payload->getPayloads().empty()) {
- foreach(boost::shared_ptr<Payload> subPayload, payload->getPayloads()) {
+
+ std::vector<boost::shared_ptr<Payload> > payloads = payload->getPayloads();
+ if (!payloads.empty()) {
+ foreach(boost::shared_ptr<Payload> subPayload, payloads) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(subPayload);
if (serializer) {
jinglePayload.addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(serializer->serialize(subPayload))));