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); } } ```
<rdar://problem/98747531>
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.
https://chromium-review.googlesource.com/c/angle/angle/+/3834820