Timer heap checks if callback is NULL

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@114 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2006-01-08 23:55:09 +00:00
parent e8a2ff5dc6
commit 30a48c61f7
1 changed files with 3 additions and 1 deletions

View File

@ -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) {