Ignore:
Timestamp:
Mar 30, 2012 7:10:13 AM (12 years ago)
Author:
bennylp
Message:

Re #1474: Merged all changes from 1.12 - HEAD (from the 1.x branch)

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk

  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r3841 r3999  
    715715 
    716716    pj_mutex_unlock(mod_tsx_layer.mutex); 
     717 
     718    PJ_LOG(4,(THIS_FILE, "Stopped transaction layer module")); 
     719 
    717720    return PJ_SUCCESS; 
     721} 
     722 
     723 
     724/* Destroy this module */ 
     725static void tsx_layer_destroy(pjsip_endpoint *endpt) 
     726{ 
     727    PJ_UNUSED_ARG(endpt); 
     728 
     729    /* Destroy mutex. */ 
     730    pj_mutex_destroy(mod_tsx_layer.mutex); 
     731 
     732    /* Release pool. */ 
     733    pjsip_endpt_release_pool(mod_tsx_layer.endpt, mod_tsx_layer.pool); 
     734 
     735    /* Free TLS */ 
     736    pj_thread_local_free(pjsip_tsx_lock_tls_id); 
     737 
     738    /* Mark as unregistered. */ 
     739    mod_tsx_layer.endpt = NULL; 
     740 
     741    PJ_LOG(4,(THIS_FILE, "Transaction layer module destroyed")); 
    718742} 
    719743 
     
    730754     * from transport and when it tries to unregister itself. 
    731755     */ 
    732     if (pj_hash_count(mod_tsx_layer.htable) != 0) 
     756    if (pj_hash_count(mod_tsx_layer.htable) != 0) { 
     757        if (pjsip_endpt_atexit(mod_tsx_layer.endpt, &tsx_layer_destroy) != 
     758            PJ_SUCCESS) 
     759        { 
     760            PJ_LOG(3,(THIS_FILE, "Failed to register transaction layer " 
     761                                 "module destroy.")); 
     762        } 
    733763        return PJ_EBUSY; 
    734  
    735     /* Destroy mutex. */ 
    736     pj_mutex_destroy(mod_tsx_layer.mutex); 
    737  
    738     /* Release pool. */ 
    739     pjsip_endpt_release_pool(mod_tsx_layer.endpt, mod_tsx_layer.pool); 
    740  
    741     /* Free TLS */ 
    742     pj_thread_local_free(pjsip_tsx_lock_tls_id); 
    743  
    744     /* Mark as unregistered. */ 
    745     mod_tsx_layer.endpt = NULL; 
    746  
    747     PJ_LOG(4,(THIS_FILE, "Transaction layer module destroyed")); 
     764    } 
     765 
     766    tsx_layer_destroy(mod_tsx_layer.endpt); 
    748767 
    749768    return PJ_SUCCESS; 
     
    32403259    PJ_UNUSED_ARG(tsx); 
    32413260    PJ_UNUSED_ARG(event); 
    3242     pj_assert(!"Not expecting any events!!"); 
    3243     return PJ_EBUG; 
    3244 } 
    3245  
     3261 
     3262    // See https://trac.pjsip.org/repos/ticket/1432 
     3263    //pj_assert(!"Not expecting any events!!"); 
     3264 
     3265    return PJ_EIGNORED; 
     3266} 
     3267 
Note: See TracChangeset for help on using the changeset viewer.