Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 385 Bytes

PH_B015.md

File metadata and controls

9 lines (5 loc) · 385 Bytes

PH_B015 - Disposed Task Instead of Value

Problem

The expression of a using-statement represents a task holding a value that is IDisposable. However, since the task is not awaited, the task itself is disposed instead of the task's value. In general, it is not necessary to dispose a task; thus, it's most likely by accident.

Solution

Await the task and dispose its value.