From b95857c3a6bf6408455bfc0e9d8d6430248fd841 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 8 Jan 2006 23:55:09 +0000 Subject: Timer heap checks if callback is NULL git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@114 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pjlib') diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c index 212f04a8..8eaab797 100644 --- a/pjlib/src/pj/timer.c +++ b/pjlib/src/pj/timer.c @@ -444,6 +444,7 @@ PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht, pj_time_val expires; PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL); + PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL); pj_gettimeofday(&expires); PJ_TIME_VAL_ADD(expires, *delay); @@ -494,7 +495,8 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, ++count; unlock_timer_heap(ht); - (*node->cb)(ht, node); + if (node->cb) + (*node->cb)(ht, node); lock_timer_heap(ht); } if (ht->cur_size && next_delay) { -- cgit v1.2.3