doceme / py-spidev

MIT License
451 stars 203 forks source link

Add missing Py_DECREF to error handling #96

Closed Gadgetoid closed 4 years ago

Gadgetoid commented 4 years ago

This should fix all of the issues I've found in #95 so far. However; It's by no means a comprehensive review of memory/reference counting issues.

For sequence length checking I have adopted the method used in xfer3 by @dimas where the length and sequence validity checks are separated since only the former requires a DECREF call.

doceme commented 4 years ago

@Gadgetoid, have you tested this enough to feel confident including it in the next release?

Gadgetoid commented 4 years ago

@doceme yes- I have had a number of customers install the modified version of the library and report that it fixed their issue. No other side-effects have (yet) been reported. I've also run it with success for some time, albeit I had to move on to other things since.