DescriptionRemove "delete this" pattern from UsbContext completely.
This change fixes a much rarer possible use-after-free on USB context
shutdown than commit 3219ab0a9caf806b6dda0fe970869735726a5481. If there
is an event that wakes up the event loop thread after running_ is set to
false then the context could be freed before the attempt to wake it up
with libusb_interrupt_handle_event() is made, instead signaling a freed
object.
This change instead makes it the responsibility of UsbContext to free
the UsbEventHandler once its thread has been joined.
BUG=518749
R=rockot@chromium.org
Committed: https://crrev.com/7ecee444661e8b855c15171615d68162602c39fa
Cr-Commit-Position: refs/heads/master@{#342711}
Patch Set 1 #Patch Set 2 : Make UsbEventHandler a SimpleThread. #
Messages
Total messages: 7 (1 generated)
|