Fix by MikaelBox from https://github.com/dayjaby/zebra-scanner/issues/22 issue.
Tested on Raspberry Pi4 Bullseye, Python 3.9.2. pybind11 version does not matter (tested both with latest v2.10.1 and pybind11 v2.5.0)
Edit: I removed scanner.dict from the code because it gave an error. So maybe pybind11 version still matters.
Segfault still happens at disconnect, but its usable for my purposes now.
Fix by MikaelBox from https://github.com/dayjaby/zebra-scanner/issues/22 issue. Tested on Raspberry Pi4 Bullseye, Python 3.9.2. pybind11 version does not matter (tested both with latest v2.10.1 and pybind11 v2.5.0) Edit: I removed scanner.dict from the code because it gave an error. So maybe pybind11 version still matters. Segfault still happens at disconnect, but its usable for my purposes now.