- /* why? if somebody is using, then you can't free! ok... but will return MSG_OK? when this task will be destroyed? isn't the user code wrong? */
- task->simdata->refcount--;
- if (task->simdata->refcount > 0)
- return MSG_OK;
+ if (task->simdata->isused) {
+ /* the task is still being used, it may be an unfinished dsend */
+ MSG_task_cancel(task);
+ }