Ignore:
Timestamp:
Oct 21, 2008 2:29:47 PM (14 years ago)
Author:
nanang
Message:

Ticket #558: Added srtp_deinit() function and registered this with pj_atexit().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r2242 r2353  
    261261} 
    262262 
     263static void pjmedia_srtp_deinit_lib(void); 
     264 
    263265static pj_status_t pjmedia_srtp_init_lib(void) 
    264266{ 
     
    274276        } 
    275277 
     278        if (pj_atexit(pjmedia_srtp_deinit_lib) != PJ_SUCCESS) { 
     279            /* There will be memory leak when it fails to schedule libsrtp  
     280             * deinitialization, however the memory leak could be harmless, 
     281             * since in modern OS's memory used by an application is released  
     282             * when the application terminates. 
     283             */ 
     284            PJ_LOG(4, (THIS_FILE, "Failed to register libsrtp deinit.")); 
     285        } 
     286 
    276287        initialized = PJ_TRUE; 
    277288    } 
    278289     
    279290    return PJ_SUCCESS; 
     291} 
     292 
     293static void pjmedia_srtp_deinit_lib(void) 
     294{ 
     295    err_status_t err; 
     296 
     297    err = srtp_deinit(); 
     298    if (err != err_status_ok) { 
     299        PJ_LOG(4, (THIS_FILE, "Failed to deinitialize libsrtp: %s",  
     300                   get_libsrtp_errstr(err))); 
     301    } 
    280302} 
    281303 
Note: See TracChangeset for help on using the changeset viewer.