From 601a3aad5a2011d1a45f203d4e2b16431d023e18 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 5 Apr 2018 12:26:23 +0200 Subject: [PATCH] Fixed issue in local-conference-event-handler related to Contents --- .../handlers/local-conference-event-handler.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index 8f56e74e5..a9aca08b7 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -109,8 +109,8 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) list contents; for (const auto &eventLog : events) { - Content content; - content.setContentType(ContentType("application","conference-info")); + Content *content = new Content(); + content->setContentType(ContentType("application","conference-info")); string body; shared_ptr notifiedEvent = static_pointer_cast(eventLog); int eventNotifyId = static_cast(notifiedEvent->getNotifyId()); @@ -180,13 +180,15 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) L_ASSERT(false); continue; } - content.setBody(body); - contents.push_back(&content); + content->setBody(body); + contents.push_back(content); } if (contents.empty()) return ""; - return ContentManager::contentListToMultipart(contents).getBodyAsString(); + string multipart = ContentManager::contentListToMultipart(contents).getBodyAsString(); + contents.clear(); + return multipart; } string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded (const Address &addr, int notifyId) {