Closed goldendeng closed 6 years ago
HI,
Can you please reconfigure https://github.com/daynix/UsbDk/blob/master/.appveyor.yml in your repo to send notifications to you instead of devel@daynix.com?
Thanks.
Sorry, I didn't understand the question. What do you refer to as "it"?
Thanks.
I'm sorry about this, but I have changed it now.
I mean, no such code, this function can run normally, so I want to ask about the function of this code.
@goldendeng So you are saying that the local variable "driverAccess" is not necessary in the UsbDk_StopRedirect function?
@sameehj Yes, I think so.
You are right, can you please send a pull request that resolves this?
Note that this is not a 'local variable'. This is an object with constructor that raises exception in case it can't access the driver from the helper at the moment of the call. It also creates additional handle on the driver's device file which is closed when the UsbDk_StopRedirect procedure is fully completed. Such referencing is typical to protect the flow from corner cases. I would revert the commit until there is more serious reason to remove this reference than just 'Stop redirect works without it'.
I would revert the commit and rename the variable to reflect the actual functionality that happens during its creation.
I have a question about this code:UsbDk_StopRedirect
In fact, it can stop redirection without using this operation.