You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2017/03/30 21:12:19 UTC

[02/37] incubator-mynewt-core git commit: net/oic; when deleting resource, remove it from oc_app_resources list.

net/oic; when deleting resource, remove it from oc_app_resources
list.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/0df95ce1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/0df95ce1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/0df95ce1

Branch: refs/heads/nrf_cputime
Commit: 0df95ce1f7734aed927b68f7df7dcf1edd7ba603
Parents: cebfd2e
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Sun Mar 26 16:22:52 2017 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Sun Mar 26 16:22:52 2017 -0700

----------------------------------------------------------------------
 net/oic/src/api/oc_ri.c | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0df95ce1/net/oic/src/api/oc_ri.c
----------------------------------------------------------------------
diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c
index d6180a6..d5779e5 100644
--- a/net/oic/src/api/oc_ri.c
+++ b/net/oic/src/api/oc_ri.c
@@ -251,6 +251,14 @@ oc_ri_alloc_resource(void)
 void
 oc_ri_delete_resource(oc_resource_t *resource)
 {
+    oc_resource_t *tmp;
+
+    SLIST_FOREACH(tmp, &oc_app_resources, next) {
+        if (tmp == resource) {
+            SLIST_REMOVE(&oc_app_resources, tmp, oc_resource, next);
+            break;
+        }
+    }
     os_memblock_put(&oc_resource_pool, resource);
 }