dokan-dev / dokan-dotnet

Dokan DotNet Wrapper
http://dokan-dev.github.io
MIT License
462 stars 116 forks source link

Readability, IoC, Graceful disposing changes #304

Closed TrabacchinLuigi closed 2 years ago

TrabacchinLuigi commented 2 years ago

DokanFileInfo: no need to dispose twice the SafeFileHandle using get's lowered to a try-finally block. DokanFileInfo: More verbose and explicit way of getting a GCHandle and an IntPtr from it. DokanInstance: Leverage language expressiveness to make clearer what should not be changed, also expose a property to show if it is disposed. Mirror Notify class is now disposable and check if DokanInstance has been already disposed before making any call. Mirror and RegistryFs now handle the CancelKeyPress gracefully.

Liryna commented 2 years ago

I will take a look at this tomorrow (hopefully). It looks 🚀

Liryna commented 2 years ago

That's a really good cleanup @TrabacchinLuigi ! Good work and thank a lot again for your contributions!