Made small change to sample app to ensure that all clients are notified
authorJoseph Morrow <joseph.l.morrow@intel.com>
Tue, 14 Oct 2014 16:04:31 +0000 (12:04 -0400)
committerJoseph Morrow <joseph.l.morrow@intel.com>
Tue, 14 Oct 2014 20:57:49 +0000 (13:57 -0700)
when a server's resource is deleted.

Change-Id: I7eae7c365d9b570ac377d18e50c72e0477862d08

csdk/stack/src/ocstack.c

index 700f68e..d1d9d84 100644 (file)
@@ -292,6 +292,9 @@ OCStackResult OCStop()
         return OC_STACK_ERROR;
     }
 
+    // Free memory dynamically allocated for resources
+    deleteAllResources();
+
     // Make call to OCCoAP layer
     if (OCStopCoAP() == OC_STACK_OK)
     {
@@ -305,9 +308,6 @@ OCStackResult OCStop()
         result = OC_STACK_ERROR;
     }
 
-    // Free memory dynamically allocated for resources
-    deleteAllResources();
-
     if (result != OC_STACK_OK) {
         OC_LOG(ERROR, TAG, PCF("Stack stop error"));
     }