Index: pjsip/src/pjsip/sip_transaction.c =================================================================== --- a/pjsip/src/pjsip/sip_transaction.c (revision 5510) +++ b/pjsip/src/pjsip/sip_transaction.c (working copy) @@ -1158,20 +1158,20 @@ pjsip_event event; entry->id = 0; + if (tsx->state < PJSIP_TSX_STATE_DESTROYED) { + PJ_LOG(5,(tsx->obj_name, "%s timer event", + (entry==&tsx->retransmit_timer ? "Retransmit":"Timeout"))); + pj_log_push_indent(); - PJ_LOG(5,(tsx->obj_name, "%s timer event", - (entry==&tsx->retransmit_timer ? "Retransmit":"Timeout"))); - pj_log_push_indent(); + PJSIP_EVENT_INIT_TIMER(event, entry); + /* Dispatch event to transaction. */ + pj_grp_lock_acquire(tsx->grp_lock); + (*tsx->state_handler)(tsx, &event); + pj_grp_lock_release(tsx->grp_lock); - PJSIP_EVENT_INIT_TIMER(event, entry); - - /* Dispatch event to transaction. */ - pj_grp_lock_acquire(tsx->grp_lock); - (*tsx->state_handler)(tsx, &event); - pj_grp_lock_release(tsx->grp_lock); - - pj_log_pop_indent(); + pj_log_pop_indent(); + } } }