- if (OCDeleteResource(NotificationResource.handle) != OC_STACK_OK)
- {
- NS_LOG(ERROR, "Fail to Delete Notification Resource");
- return NS_ERROR;
- }
-
- if (OCDeleteResource(NotificationMessageResource.handle) != OC_STACK_OK)
- {
- NS_LOG(ERROR, "Fail to Delete Notification Message Resource");
- return NS_ERROR;
- }
-
- if (OCDeleteResource(NotificationSyncResource.handle) != OC_STACK_OK)
- {
- NS_LOG(ERROR, "Fail to Delete Notification Sync Resource");
- return NS_ERROR;
- }
-
- if (OCDeleteResource(NotificationTopicResource.handle) != OC_STACK_OK)
- {
- NS_LOG(ERROR, "Fail to Delete Notification Topic Resource");
- return NS_ERROR;
- }
+ NS_DELETE_RESOURCE(
+ OCDeleteResource(NotificationResource.handle), "Fail to Delete Notification Resource");
+ NS_DELETE_RESOURCE(OCDeleteResource(NotificationMessageResource.handle),
+ "Fail to Delete Notification Message Resource");
+ NS_DELETE_RESOURCE(OCDeleteResource(NotificationSyncResource.handle),
+ "Fail to Delete Notification Sync Resource");
+ NS_DELETE_RESOURCE(OCDeleteResource(NotificationTopicResource.handle),
+ "Fail to Delete Notification Topic Resource");