attie / libxbee3

A C/C++ library to aid the use of Digi XBee radios in API mode
GNU Lesser General Public License v3.0
68 stars 40 forks source link

xbee instance shutdown log message not suppressed #27

Closed hsgreen closed 6 years ago

hsgreen commented 7 years ago

In xbee.c:xbee_free(...) a call to xbee_log is made after freeing the xbee data structure and its log member. The call in xbee_log(...) that checks the log level then is unpredictable because the referenced memory has been freed.

This results in the log message being displayed sometimes even if the log level for that instance was set to less than the value associated with the call printing "Completed shutdown procedure....".

attie commented 6 years ago

Thanks for pointing this out... I've now fixed it in c44b131.