Subscribe to the Inserted and Removed events to be notified when a USB drive is plugged in or unplugged, or when a USB device is connected or disconnected. Usb.Events is a .NET Standard 2.0 library and uses WMI on Windows, libudev on Linux and IOKit on macOS.
On line 245 of UsbEventWatcher.Linux.c there appears to be a memory leak. 'dev' is never unreferenced in GetLinuxMountPoint(). I noticed allocated memory ticking up in my test application. I looked over the code and noticed the aforementioned.
On line 245 of UsbEventWatcher.Linux.c there appears to be a memory leak. 'dev' is never unreferenced in GetLinuxMountPoint(). I noticed allocated memory ticking up in my test application. I looked over the code and noticed the aforementioned.