Changeset 2893


Ignore:
Timestamp:
Aug 17, 2009 3:56:18 PM (15 years ago)
Author:
nanang
Message:

Ticket #833: Fixed bug session timer won't work properly after pjsua-lib restarted, by adding deinit module function for session timer and register the deinit function into atexit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c

    r2890 r2893  
    476476} 
    477477 
     478/* Deinitialize Session Timers */ 
     479static void pjsip_timer_deinit_module(void) 
     480{ 
     481    is_initialized = PJ_FALSE; 
     482} 
     483 
    478484/* 
    479485 * Initialize Session Timers support in PJSIP.  
     
    505511    if (status != PJ_SUCCESS) 
    506512        return status; 
     513 
     514    /* Register deinit module to be executed when PJLIB shutdown */ 
     515    if (pj_atexit(&pjsip_timer_deinit_module) != PJ_SUCCESS) { 
     516        /* Failure to register this function may cause this module won't  
     517         * work properly when the stack is restarted (without quitting  
     518         * application). 
     519         */ 
     520        pj_assert(!"Failed to register Session Timer deinit."); 
     521        PJ_LOG(1, (THIS_FILE, "Failed to register Session Timer deinit.")); 
     522    } 
    507523 
    508524    is_initialized = PJ_TRUE; 
     
    9931009    return PJ_SUCCESS; 
    9941010} 
    995  
Note: See TracChangeset for help on using the changeset viewer.