diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-01-08 23:55:09 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-01-08 23:55:09 +0000 |
commit | b95857c3a6bf6408455bfc0e9d8d6430248fd841 (patch) | |
tree | 68656e8906873b5cf03e6df9f4af7c492dfb7c02 /pjlib/src | |
parent | 7fd16f7022d3649d68fc4b9189a165387b5556e3 (diff) |
Timer heap checks if callback is NULL
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@114 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r-- | pjlib/src/pj/timer.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |