eina_log: reset logging callback to default when null is set as the callback

Summary:
passing null here causes any log message to crash the app and is probably not
the intended result

Reviewers: cedric, segfaultxavi

Reviewed By: cedric, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8513
This commit is contained in:
Mike Blumenkrantz 2019-03-29 18:50:30 +01:00 committed by Xavi Artigas
parent b8952604ce
commit 69c54cdabb
1 changed files with 4 additions and 1 deletions

View File

@ -1720,7 +1720,10 @@ eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data)
{
#ifdef EINA_ENABLE_LOG
LOG_LOCK();
_print_cb = cb;
if (cb)
_print_cb = cb;
else
_print_cb = eina_log_print_cb_stderr;
_print_cb_data = data;
eina_log_print_prefix_update();
LOG_UNLOCK();