Can “using” with more than one resource cause a resource leak?
No. The compiler will generate a separate finally block for each variable. The spec (ยง8.13) says: When a resource-acquisition takes the form of a local-variable-declaration, it is possible to acquire multiple resources of a given type. A using statement of the form using (ResourceType r1 = e1, r2 = e2, …, rN = eN) statement … Read more