From 2e148986f9596870c84a0dabdcb9b76dbf9644d6 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 25 Oct 2020 13:04:59 +0000 Subject: [PATCH] Feature: Improved error logging --- src/navigation.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/navigation.c b/src/navigation.c index 1e2aedc8..027f8569 100644 --- a/src/navigation.c +++ b/src/navigation.c @@ -93,8 +93,10 @@ static inline int navigation_history_push(navigation_history_t *history, mount_i if (history->fill > 0 && mount_identifier_compare(history->history[history->fill - 1], identifier) == 0) return 0; - if (refobject_ref(identifier) != 0) + if (refobject_ref(identifier) != 0) { + ICECAST_LOG_ERROR("Can not reference identifier=%p, BAD.", identifier); return -1; + } if (history->fill == (sizeof(history->history)/sizeof(*history->history))) { refobject_unref(history->history[0]); @@ -130,7 +132,7 @@ mount_identifier_t * navigation_history_get_up(navigation_history_t *history) int navigation_history_navigate_to(navigation_history_t *history, mount_identifier_t *identifier, navigation_direction_t direction) { - ICECAST_LOG_DDEBUG("Called with history=%p, identifier=%p (%#H), direction=%s", history, identifier, mount_identifier_get_mount(identifier), navigation_direction_id2str(direction)); + ICECAST_LOG_DDEBUG("Called with history=%p, identifier=%p (%#H), direction=%s", history, identifier, mount_identifier_get_mount(identifier), navigation_direction_to_str(direction)); if (!history || !identifier) return -1; @@ -157,8 +159,10 @@ int navigation_history_navigate_to(navigation_history_t *his return navigation_history_pop(history); } - if (refobject_ref(identifier) != 0) + if (refobject_ref(identifier) != 0) { + ICECAST_LOG_ERROR("Can not reference identifier=%p, BAD.", identifier); return -1; + } refobject_unref(history->history[history->fill - 1]); history->history[history->fill - 1] = identifier; return 0;