]> sigrok.org Git - libsigrok.git/commit - src/hardware/demo/api.c
demo: Provide dev_clear()
authorLars-Peter Clausen <redacted>
Fri, 29 Apr 2016 14:28:59 +0000 (16:28 +0200)
committerLars-Peter Clausen <redacted>
Tue, 3 May 2016 19:23:57 +0000 (21:23 +0200)
commit6ab687315bccddfe3d196040ccab4cff909bb086
tree60e97a3765de8762ab65dccd7a4422dbbbf69669
parent74c6d807efbd4949b3083a362816ee8cc69645fa
demo: Provide dev_clear()

Devices for the demo driver do have additional data attached to it that
needs to be freed when the device is freed. While the driver gets it right
for the cleanup() callback it does not implement a dev_clear() callback, so
the default dev_clear() implementation is used which will not free the
additional data. This will cause memory leaks when sr_dev_clear() is called
for this driver.

To fix this provide a dev_clear() implementation that frees the additional
data.

Signed-off-by: Lars-Peter Clausen <redacted>
src/hardware/demo/demo.c