Repository navigation
Commit f644ea7
Each call to libusb1's get_backend returns a new _LibUSB object.
When each _LibUSB object falls out of scope, it calls ends up
calling libusb_exit() which deinitializes libusb, even if there are still
references in scope.
Practically speaking, pyusb seems to assume there's only one
context active, so returning the same _LibUSB object on
subsequent calls to get_backend should prevent there from being
more than one call to libusb_exit() when backend objects go
out of scope.
This should fix errors where the libusb library was being used after
libusb_exit() had been called.
1 parent 53f2f20 commit f644ea7
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| |||
936 | 937 | | |
937 | 938 | | |
938 | 939 | | |
939 | | - | |
| 940 | + | |
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
943 | 944 | | |
944 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
945 | 948 | | |
946 | 949 | | |
947 | 950 | | |
| |||
0 commit comments