This fixes the following leaks:
==30517== 32,808 bytes in 1 blocks are definitely lost in loss record 11 of 12
==30517== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==30517== by 0x50F4B2A: __alloc_dir (opendir.c:186)
==30517== by 0x4E34998: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==30517== by 0x4E36350: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==30517== by 0x4E34D98: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
This fixes the following leaks:
==18690== 256 bytes in 1 blocks are definitely lost in loss record 75 of 100
==18690== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==18690== by 0x511613F: regcomp (regcomp.c:487)
==18690== by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==
==18690== 32,068 (224 direct, 31,844 indirect) bytes in 1 blocks are definitely lost in loss record 98 of 100
==18690== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==18690== by 0x4C28D6F: realloc (vg_replace_malloc.c:632)
==18690== by 0x5115DF3: re_compile_internal (regcomp.c:760)
==18690== by 0x51161AB: regcomp (regcomp.c:506)
==18690== by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690== by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
Now call only once usb_init(); usb_find_busses(); usb_find_devices()
instead of multiple calls in several scan() then open()
This fixes the following leaks:
==1159== 8 bytes in 1 blocks are definitely lost in loss record 9 of 102
==1159== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1159== by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x4E41D79: pn53x_usb_scan (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==1159==
==1159== 8 bytes in 1 blocks are definitely lost in loss record 10 of 102
==1159== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1159== by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159== by 0x4E42CC7: pn53x_usb_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==1159== by 0x4E351E6: nfc_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
The driver seems to work well.
I tested it on Linux with i.mx233-based board using hardware SPI.
I tried to modify the build files as well, but it's probably a little messy.
I'm not sure whether it will work on other *nix OSes,
so it's probably better to limit the driver to Linux only using build system.
The GIT_REVISION is set as the result of 'git describe'.
If git is not installed the old code generated an error:
$ dh_autoreconf -a
sh: 1: git: not found
sh: 1: git: not found
Thanks to Thomas Hood for the bug report
https://groups.google.com/d/msg/nfc-tools-devel/Skd03b1wUcg/xnQThAPXPCYJ
- Generate rc files from version.rc.in + CMake variable information in CMakeLists files
- Add step to generate .lib file for windows developers
- Re-structure tool flag usage, apparently ADD_DEFINTIONS adds them to _ALL_ tools. This is bad for rc files with the windres tool.
Needs other platform testing, as the flags have changed to fix Windows rc file generation.