mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
[v3.6.0] Fix memory leaks (#12185)
This commit is contained in:
@@ -47,7 +47,9 @@ PlanarShadowQueue::PlanarShadowQueue(RenderPipeline *pipeline)
|
||||
_instancedQueue = ccnew RenderInstancedQueue;
|
||||
}
|
||||
|
||||
PlanarShadowQueue::~PlanarShadowQueue() = default;
|
||||
PlanarShadowQueue::~PlanarShadowQueue() {
|
||||
destroy();
|
||||
}
|
||||
|
||||
void PlanarShadowQueue::gatherShadowPasses(scene::Camera *camera, gfx::CommandBuffer *cmdBuffer) {
|
||||
clear();
|
||||
@@ -138,7 +140,10 @@ void PlanarShadowQueue::recordCommandBuffer(gfx::Device *device, gfx::RenderPass
|
||||
}
|
||||
|
||||
void PlanarShadowQueue::destroy() {
|
||||
_pipeline = nullptr;
|
||||
CC_SAFE_DELETE(_instancedQueue);
|
||||
_castModels.clear();
|
||||
_pendingModels.clear();
|
||||
}
|
||||
|
||||
} // namespace pipeline
|
||||
|
||||
Reference in New Issue
Block a user