Skip to content

Handle leak because FindClose is never called #12

@KirillOsenkov

Description

@KirillOsenkov

I've debugged the handle leak in #11 and I've realized that FindClose is never called. If you place a breakpoint at this line it'll never get called:

retValue = NativeMethods.FindClose(handle);

The reason is at the time that function is called, IsClosed is already true, so it never enters the if statement body.

Not sure what's the best way to fix this, perhaps check for IsInvalid instead of IsClosed? Also calling SetHandleAsInvalid(); seemingly does nothing.

@JohnWintellect thanks again for the great tool, I use it daily.

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