Skip to content

Threaded Wait Dialog example: compiler warning for statement that calls Dispose on object returned by ThreadedWaitDialogHelper.CreateInstance #47

@shaneharper

Description

@shaneharper

Regarding
(twd as IDisposable).Dispose();
from the Threaded Wait Dialog example:

  1. The compiler outputs:

     warning CS8602: Dereference of a possibly null reference.
    

    What should be done to get rid of that warning?

  2. Until I saw the example code it had never occurred to me that there could be a need to call Dispose for the object returned by ThreadedWaitDialogHelper.CreateInstance(IVsThreadedWaitDialogFactory). Could a comment be added to the example explaining the need for it? Perhaps the best place to mention it would be in the documentation for CreateInstance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions