bool isStartedConsumer = NSIsStartedConsumer();
NS_VERIFY_NOT_NULL(isStartedConsumer == true ? (void *) 1 : NULL, NS_ERROR);
- NSTask * subscribeTask = NSMakeTask(TASK_CONSUMER_REQ_SUBSCRIBE, (void *) provider);
+ NSProvider * prov = (NSProvider *)NSCopyProvider((NSProvider_internal *) provider);
+ NS_VERIFY_NOT_NULL(prov, NS_ERROR);
+
+ NSTask * subscribeTask = NSMakeTask(TASK_CONSUMER_REQ_SUBSCRIBE, (void *) prov);
NS_VERIFY_NOT_NULL(subscribeTask, NS_ERROR);
return NSConsumerPushEvent(subscribeTask);
bool isStartedConsumer = NSIsStartedConsumer();
NS_VERIFY_NOT_NULL(isStartedConsumer == true ? (void *) 1 : NULL, NS_ERROR);
- NSTask * unsubscribeTask = NSMakeTask(TASK_CONSUMER_REQ_SUBSCRIBE_CANCEL, (void *) provider);
+ NSProvider * prov = (NSProvider *)NSCopyProvider((NSProvider_internal *) provider);
+ NS_VERIFY_NOT_NULL(prov, NS_ERROR);
+
+ NSTask * unsubscribeTask = NSMakeTask(TASK_CONSUMER_REQ_SUBSCRIBE_CANCEL, (void *) prov);
NS_VERIFY_NOT_NULL(unsubscribeTask, NS_ERROR);
return NSConsumerPushEvent(unsubscribeTask);
NS_VERIFY_NOT_NULL(prov, NS_ERROR);
NSSelector selector = prov->accessPolicy;
NSRemoveProvider_internal(prov);
-
NS_VERIFY_NOT_NULL(selector == NS_SELECTION_CONSUMER ? (void *) 1 : NULL, NS_ERROR);
- NSTask * topicTask = NSMakeTask(TASK_CONSUMER_GET_TOPIC_LIST, (void *) provider);
+ prov = (NSProvider *)NSCopyProvider((NSProvider_internal *) provider);
+ NS_VERIFY_NOT_NULL(prov, NS_ERROR);
+
+ NSTask * topicTask = NSMakeTask(TASK_CONSUMER_GET_TOPIC_LIST, (void *) prov);
NS_VERIFY_NOT_NULL(topicTask, NS_ERROR);
return NSConsumerPushEvent(topicTask);
NSRemoveProvider_internal(prov);
NS_VERIFY_NOT_NULL(selector == NS_SELECTION_CONSUMER ? (void *) 1 : NULL, NS_ERROR);
- NSTask * topicTask = NSMakeTask(TASK_CONSUMER_SELECT_TOPIC_LIST, (void *) provider);
- NS_VERIFY_NOT_NULL(provider, NS_ERROR);
+ prov = (NSProvider *)NSCopyProvider((NSProvider_internal *) provider);
+ NS_VERIFY_NOT_NULL(prov, NS_ERROR);
+
+ NSTask * topicTask = NSMakeTask(TASK_CONSUMER_SELECT_TOPIC_LIST, (void *) prov);
+ NS_VERIFY_NOT_NULL(topicTask, NS_ERROR);
return NSConsumerPushEvent(topicTask);
}