---
title: DestroyOperation
description: "销毁Operation。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0041.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0041.html
indexId: 5a35e5c3318f26b7a795a5c51efe15a14e7c68c5c0e0f3a9734fc53d6225f82e64
---
# DestroyOperation

#### 功能说明

销毁Operation。


#### 定义

```
Status DestroyOperation(Operation *operation);
```


#### 参数列表

| 参数名称 | 输入/输出 | 描述 |
| --- | --- | --- |
| operation | 输入 | Operation的指针。 |


#### 返回值说明

| 类型 | 输入/输出 | 说明 |
| --- | --- | --- |
| Status | 输出 | 返回NO\_ERROR表示成功，返回其它值表示失败。 |


#### 约束说明

与CreateOperation接口配对使用，先调用CreateOperation接口再调用DestroyOperation接口。

调用CreateOperation创建的Operation在使用完毕后，需调用DestroyOperation接口销毁，否则将导致内存泄漏。

支持atb/infer_op_params.h和atb/train_op_params.h的参数。
