You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net: lwm2m: Stop the LwM2M engine in case of fatal network error
In case of fatal network error (i.e. when the LwM2M client runs out of
retries), call lwm2m_engine_stop() to cleanup any allocated resources
for the client. The engine is dead at that point anyway so the
application needs to recover.
If this isn't done, it is theoretically possible to restart the LwM2M
client (with lwm2m_rd_client_start() which does not report an error in
such case), which in turn could lead to resource leaks (like for
example the observer list is reinitialized) if the application
didn't call lwm2m_rd_client_stop() first. Calling lwm2m_engine_stop()
ensures that all resources are freed even if the application doesn't
call stop before restarting.
Stopping the engine is also needed when the network error occurs when
de-registering - in such case the engine goes straight into the IDLE
state, where it's possible to restart the client and thus reinitialize
the observer lists.
Signed-off-by: Robert Lubos <[email protected]>
0 commit comments