USB Disconnect Leaks Fixed

A project log for USB Interruptor

Press the button to momentarily disconnect a USB device

paul-stoffregenPaul Stoffregen 02/26/2017 at 22:400 Comments

Exciting news: with this commit (and several others just before it), I've finally managed to free all the memory resources when a USB device disconnects.

I just disconnected and re-enumerated a USB keyboard 60 times in a row. Previously I could only do this a few times (and a week ago not at all due to other limitations) before all the slots in the memory for devices & pipes were used up.

Now all the resources are being returned, or at least all the ones in use for this simple test. Still so many more cases to consider....