[Resource Encapsulation] Fixed Sample APP issue 01/2101/2
authorJay Sharma <jay.sharma@samsung.com>
Tue, 4 Aug 2015 07:00:25 +0000 (12:30 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Tue, 4 Aug 2015 07:46:40 +0000 (07:46 +0000)
Change-Id: I1a90ec626f29b195ae1f4dde2d46b72fbc991133
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2101
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/examples/linux/SampleResourceServer.cpp

index 1e9ecf9..f7c946c 100755 (executable)
@@ -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)
     {