> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# destroy

APISummary
当 `LynxView` 不再可用后，需要主动调用该方法释放 `LynxView` 内存，否则会产生内存泄漏。

## 语法

### Android

```java
public void destroy();
```

### Desktop (C++)

Desktop C++ API 没有单独暴露 `destroy()` 方法。销毁或 reset 持有的 C++ 对象即可释放 `LynxView`。

```cpp
std::unique_ptr<lynx::pub::LynxView> view = builder.Build();
// ...
view.reset();
```

## 兼容性

**Compatibility Table**

**Query:** `lynx-native-api.lynx-view.destroy`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-view/destroy.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| destroy | Yes (1.0) | No | No | Yes (3.7) | Yes (3.7) | No |

**`destroy`**

manually destroy lynxView instance

**Specifications:**

