mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
fix memory leak (#11700)
This commit is contained in:
@@ -52,6 +52,7 @@ void BatchedBuffer::destroyBatchedBuffer() {
|
||||
BatchedBuffer *batchedBuffer = item.second;
|
||||
if (batchedBuffer) {
|
||||
batchedBuffer->destroy();
|
||||
delete batchedBuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,11 +74,14 @@ public:
|
||||
inline const DynamicOffsetList &getDynamicOffset() const { return _dynamicOffsets; }
|
||||
|
||||
private:
|
||||
// uint32_t: extraKey, passed in BatchedBuffer::get();
|
||||
static ccstd::unordered_map<scene::Pass *, ccstd::unordered_map<uint32_t, BatchedBuffer *>> buffers;
|
||||
DynamicOffsetList _dynamicOffsets;
|
||||
BatchedItemList _batches;
|
||||
const scene::Pass *_pass = nullptr;
|
||||
gfx::Device *_device = nullptr;
|
||||
// weak reference
|
||||
const scene::Pass *_pass{nullptr};
|
||||
// weak reference
|
||||
gfx::Device *_device{nullptr};
|
||||
};
|
||||
|
||||
} // namespace pipeline
|
||||
|
||||
Reference in New Issue
Block a user