]> sigrok.org Git - libsigrok.git/commit
Don't reset instance list in scan() callback
authorLars-Peter Clausen <redacted>
Sun, 15 May 2016 15:20:51 +0000 (17:20 +0200)
committerUwe Hermann <redacted>
Fri, 27 May 2016 12:43:34 +0000 (14:43 +0200)
commit566007e15e8ec0a23b064ba8ea44baae305508b5
tree5c610f6447d5c0930d618912c10d681c62f47b75
parentd268866d294f8ab94e14881caf5d0126e5b77a91
Don't reset instance list in scan() callback

Some drivers set the device instance list to NULL in their scan() callback.
This means the driver loses all references to any devices contained in that
list and their resources will be leaked. Drivers can't free the devices at
this point either since an application might still use a device on the
list. So the existing devices on the instance list need to remain
unmodified during the scan() callback, even if that means that there will
be duplicates on the instance list. Only an explicit invocation of
sr_dev_clear() by the application is allowed to free the devices on the
instance list and reset the list.

Signed-off-by: Lars-Peter Clausen <redacted>
23 files changed:
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/arachnid-labs-re-load-pro/api.c
src/hardware/atten-pps3xxx/api.c
src/hardware/beaglelogic/api.c
src/hardware/brymen-bm86x/api.c
src/hardware/brymen-dmm/api.c
src/hardware/chronovu-la/api.c
src/hardware/colead-slm/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/ftdi-la/api.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/ikalogic-scanalogic2/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/korad-kaxxxxp/api.c
src/hardware/lecroy-logicstudio/api.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/norma-dmm/api.c
src/hardware/teleinfo/api.c
src/hardware/testo/api.c
src/hardware/tondaj-sl-814/api.c
src/hardware/uni-t-ut32x/api.c