# null

## ChkControl\_Destroy

[CAPL Functions](../../CAPLfunctions.md) » [Test Service Library](../CAPLfunctionsTSLOverview.md) » [Commands to Control Checks](../CAPLfunctionsTSLCheckControlCommands.md) » ChkControl\_Destroy

**Valid for**: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

### Function Syntax

```c
long ChkControl_Destroy(dword aCheckId);
```

### Constructor

[Constructor](../../../Shared/CAPL/General/ClassesAndObjects.md)

```c
check.Destroy();
```

### Description

The check is destroyed and cannot be accessed anymore. Its resources are freed.

### Parameters

* **aCheckId**: Must exist

### Return Values

* **0**: successful
* **\< 0**: error

### Possible Errors

* Check for given id does not exist

### Example

```c
dword checkId;
dword numCheckEvents;

// start the Error Frame observation
checkId = ChkStart_ErrorFramesOccured();
// Add check as condition
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check
ChkControl_Stop(checkId);

// destroy check
ChkControl_Destroy(checkId);
```
