| Summary: | Leak of id<MTLArgumentEncoder> in rx::(anonymous)::InitArgumentBufferEncoder() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | ANGLE | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dino, kbr, kkinnunen, kpiddington, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 218877, 219260 | ||
| Bug Blocks: | |||
This regressed in commit 6b271237a02594f551ab5948d7d2951addfda81f (232042@main) on Dec 02, 2020. Pull request: https://github.com/WebKit/WebKit/pull/3380 Committed 253525@main (06f230986084): <https://commits.webkit.org/253525@main> Reviewed commits have been landed. Closing PR #3380 and removing active labels. |
Leak of id<MTLArgumentEncoder> in rx::(anonymous)::InitArgumentBufferEncoder(). The struct is defined like this in ProgramMtl.h: ``` struct ProgramArgumentBufferEncoderMtl { void reset(ContextMtl *contextMtl); mtl::AutoObjCPtr<id<MTLArgumentEncoder>> metalArgBufferEncoder; mtl::BufferPool bufferPool; }; ``` However the method doesn't adopt the object in ProgramMtl.mm, which causes it to be assigned with a +2 retain count: ``` void InitArgumentBufferEncoder(mtl::Context *context, id<MTLFunction> function, uint32_t bufferIndex, ProgramArgumentBufferEncoderMtl *encoder) { encoder->metalArgBufferEncoder = [function newArgumentEncoderWithBufferIndex:bufferIndex]; // LEAK! if (encoder->metalArgBufferEncoder) { encoder->bufferPool.initialize(context, encoder->metalArgBufferEncoder.get().encodedLength, mtl::kArgumentBufferOffsetAlignment, 0); } } ```