Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 401 Bytes

PH_B011.md

File metadata and controls

9 lines (5 loc) · 401 Bytes

PH_B011 - Returning a Task based on a Disposed Value

Problem

A task object is returned, although the enclosing using statement disposes the relevant object. This constellation can lead to the undesired disposal of the object during the execution of the task.

Solution

Await the returned task to ensure that the object is only disposed after the completion of the asynchronous operation.