From: abitha.s Date: Mon, 23 Jan 2017 11:58:30 +0000 (+0530) Subject: [IOT-1772]Returning copy of TopicList in Cpnsumer Service API for APP X-Git-Tag: 1.3.0~774 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8aae021c79bd4347269ecd847b92ef2e8b139d82;p=platform%2Fupstream%2Fiotivity.git [IOT-1772]Returning copy of TopicList in Cpnsumer Service API for APP Change-Id: Iab88c037ec30ad961bada01579daf0c4d470596d Signed-off-by: abitha.s Reviewed-on: https://gerrit.iotivity.org/gerrit/16701 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp b/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp index 8ba14a0..fe6df90 100755 --- a/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp +++ b/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp @@ -106,7 +106,12 @@ namespace OIC NSTopicsList *NSProvider::getTopicList() const { NS_LOG(DEBUG, "getTopicList - IN"); - return m_topicList; + NSTopicsList * topicList = new NSTopicsList(); + for (auto it : m_topicList->getTopicsList()) + { + topicList->addTopic(it->getTopicName(), it->getState()); + } + return topicList; } NSResult NSProvider::updateTopicList(NSTopicsList *topicList)