edgexfoundry / device-sdk-c

Owner: Device WG
Apache License 2.0
42 stars 42 forks source link

fix: Remove the refcount from the autoevent impl structure #502

Closed FelixTing closed 8 months ago

FelixTing commented 9 months ago

fix: #494

The refcount in the edgex_autoimpl structure is a legacy of the earlier scheduler implementation.

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

Run in debug mode and set a breakpoint at the first line of the ae_runner function. When the breakpoint is hit, delete the device and resume the program.

With this fix the device service is running smoothly without getting a segmentation fault.

level=INFO ts=2023-12-21T15:09:53Z app=device-random correlation-id=14a42ea6-c394-41c3-8bcd-a29b9f5e6835 msg="callback: Delete device RandomDevice1"
level=ERROR ts=2023-12-21T15:09:53Z app=device-random msg="Autoevent fired for unknown device RandomDevice1"