Commit
4b9234088f56 introduced the fetch and restore of the libraries'
default log routines in addition to the registration of a Pulseview
application's log routine. Some code paths in main() could result in
unexpected "cb was NULL" messages on stderr, when logging::init() did
not execute but the destructor tried to restore a handler which was not
fetched before. Silence the error message.
Logging::~Logging()
{
qInstallMessageHandler(nullptr);
- sr_log_callback_set(prev_sr_log_cb, prev_sr_log_cb_data);
+ if (prev_sr_log_cb)
+ sr_log_callback_set(prev_sr_log_cb, prev_sr_log_cb_data);
prev_sr_log_cb = nullptr;
prev_sr_log_cb_data = nullptr;
#ifdef ENABLE_DECODE
- srd_log_callback_set(prev_srd_log_cb, prev_srd_log_cb_data);
+ if (prev_srd_log_cb)
+ srd_log_callback_set(prev_srd_log_cb, prev_srd_log_cb_data);
prev_srd_log_cb = nullptr;
prev_srd_log_cb_data = nullptr;
#endif