34 lines
729 B
Markdown
34 lines
729 B
Markdown
|
|
# RHIDescriptorPool::~RHIDescriptorPool
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
virtual ~RHIDescriptorPool() = default;
|
||
|
|
```
|
||
|
|
|
||
|
|
虚析构函数,确保派生类对象能被正确销毁。
|
||
|
|
|
||
|
|
## 详细描述
|
||
|
|
|
||
|
|
析构函数是虚函数,允许通过基类指针正确删除派生类对象。在销毁描述符池前,应确保已经调用 [`Shutdown`](shutdown.md) 释放资源。
|
||
|
|
|
||
|
|
## 参数列表
|
||
|
|
|
||
|
|
无参数。
|
||
|
|
|
||
|
|
## 返回值
|
||
|
|
|
||
|
|
无返回值。
|
||
|
|
|
||
|
|
## 示例代码
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
// 通过基类指针销毁派生类对象
|
||
|
|
RHIDescriptorPool* pool = factory->CreateDescriptorPool();
|
||
|
|
// ... 使用 pool
|
||
|
|
delete pool; // 正确调用析构函数
|
||
|
|
```
|
||
|
|
|
||
|
|
## 相关文档
|
||
|
|
|
||
|
|
- [RHIDescriptorPool 总览](descriptor-pool.md) - 返回类总览
|
||
|
|
- [Shutdown](shutdown.md) - 关闭描述符池
|