From 3bda1c172f20a48675a4e65d42957f1c5b5b997b Mon Sep 17 00:00:00 2001 From: Jay Sharma Date: Tue, 4 Aug 2015 12:30:25 +0530 Subject: [PATCH] [Resource Encapsulation] Fixed Sample APP issue Change-Id: I1a90ec626f29b195ae1f4dde2d46b72fbc991133 Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/2101 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../resource-encapsulation/examples/linux/SampleResourceServer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp index 1e9ecf9..f7c946c 100755 --- a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp +++ b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp @@ -105,8 +105,8 @@ RCSSetResponse requestHandlerForSet(const RCSRequest& request, std::cout << "Recieved a Set request from Client" << std::endl; std::cout << "\n\nSending response to Client : " << std::endl; - printAttribute(server->getAttributes()); - + RCSResourceObject::LockGuard lock(*server); + printAttribute(attrs); return RCSSetResponse::defaultAction(); } @@ -226,7 +226,7 @@ void process() { displayControlTemperatureMenu(); - if(selectControlTemperatureMenu() == QUIT) break; + if (selectControlTemperatureMenu() == QUIT) return; } } @@ -237,6 +237,7 @@ int main(void) try { process(); + server = NULL; } catch (const std::exception& e) { -- 2.7.4