Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
489 stars 168 forks source link

fix resource leak in Message.Load(FileInfo) #409

Closed kellybirr closed 4 months ago

kellybirr commented 4 months ago

The old code did not dispose the file stream opened by file.OpenRead() until the garbage collector caught it. This change explicitly disposes the file stream and releases the file lock and the resources.

kellybirr commented 4 months ago

Hi, thanks for the awesome open-source project. I found a missing using that was causing temporary resource leaks and file locks. This PR should resolve the issue.

Sicos1977 commented 4 months ago

Thanks for your nice words. I also have to fix one more issue before I release a new nuget package.