@@ -119,10 +119,6 @@ void starpu_task_clean(struct starpu_task *task)
_starpu_job_destroy(j);
task->starpu_private = NULL;
}
-
- /* Does user want StarPU release cl_arg ? */
- if (task->cl_arg_free)
- free(task->cl_arg);
struct starpu_task * __attribute__((malloc)) starpu_task_create(void)
@@ -160,6 +156,10 @@ void _starpu_task_destroy(struct starpu_task *task)
/* TODO handle the case of task with detach = 1 and destroy = 1 */
/* TODO handle the case of non terminated tasks -> return -EINVAL */
+ /* Does user want StarPU release cl_arg ? */
+ if (task->cl_arg_free)
+ free(task->cl_arg);
+
free(task);
@@ -343,7 +343,6 @@ int _starpu_insert_task_create_and_submit(void *arg_buffer, size_t arg_buffer_si
(*task)->cl = cl;
(*task)->cl_arg = arg_buffer;
(*task)->cl_arg_size = arg_buffer_size;
- (*task)->cl_arg_free = 1;
/* The callback will free the argument stack and execute the
* application's callback, if any. */