src → processedMat → paddedMat →), and each resource requires cleanup. Using nested acquireUseRelease blocks quickly becomes unwieldy. What pattern or abstraction can I use to manage these dependent resources linearly (without deep nesting) while ensuring: cv.cvtColor or padImage that produce new resources (if they allocate internally).