# DeleteTask

Destroys the task object and frees the memory.

## Syntax

Fortran:

errcode = vslconvdeletetask(task)

errcode = vslcorrdeletetask(task)

C:

errcode = vslConvDeleteTask(task);

errcode = vslCorrDeleteTask(task);

## Description

Given a pointer to a task descriptor, this routine deletes the task descriptor object and frees the memory allocated for the data structure. If the task holds a work memory, the latter is also freed. The task pointer is set to NULL.

Note that if by some reason the task was not deleted successfully, the routine returns an error code. This error code has no relation to the task status code and does not change it.

### Note

You can use the NULL task pointer in calls to destructor routines. In this case, the routine will be terminated and no system crash will occur.

## Input Parameters

Name | Type | Description
--- | --- | ---
task | FORTRAN: TYPE(VSL_CONV_TASK) for vslconvdeletetask TYPE(VSL_CORR_TASK) for vslcorrdeletetask C: VSLConvTaskPtr* for vslConvDeleteTask VSLCorrTaskPtr* for vslCorrDeleteTask | Pointer to the task descriptor.

## Output Parameters

Name | Type | Description
--- | --- | ---
errcode | FORTRAN: INTEGER C: int | Contains 0 if the task object is deleted successfully. Contains error code if an error occurred.

Parent topic: Task Destructors