Changeset 5604
- Timestamp:
- Jun 14, 2017 6:04:12 AM (7 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r5597 r5604 159 159 pj_status_t status); 160 160 161 /* 162 * Clean up ICE resources. 163 */ 164 static void tp_ice_on_destroy(void *arg); 165 161 166 162 167 static pjmedia_transport_op transport_ice_op = … … 289 294 *p_tp = NULL; 290 295 return status; 296 } 297 298 /* Sync to ICE */ 299 { 300 pj_grp_lock_t *grp_lock = pj_ice_strans_get_grp_lock(tp_ice->ice_st); 301 pj_grp_lock_add_ref(grp_lock); 302 pj_grp_lock_add_handler(grp_lock, pool, tp_ice, &tp_ice_on_destroy); 291 303 } 292 304 … … 1789 1801 1790 1802 tp_ice = (struct transport_ice*) pj_ice_strans_get_user_data(ice_st); 1803 if (!tp_ice) { 1804 /* Destroy on progress */ 1805 return; 1806 } 1791 1807 1792 1808 if (comp_id==1 && tp_ice->rtp_cb) { … … 1926 1942 1927 1943 tp_ice = (struct transport_ice*) pj_ice_strans_get_user_data(ice_st); 1944 if (!tp_ice) { 1945 /* Destroy on progress */ 1946 return; 1947 } 1928 1948 1929 1949 pj_perror(5, tp_ice->base.name, result, "ICE operation complete" … … 1965 1985 } 1966 1986 1987 static void tp_ice_on_destroy(void *arg) 1988 { 1989 struct transport_ice *tp_ice = (struct transport_ice*)arg; 1990 pj_pool_safe_release(&tp_ice->pool); 1991 } 1967 1992 1968 1993 /* … … 1973 1998 struct transport_ice *tp_ice = (struct transport_ice*)tp; 1974 1999 2000 /* Reset callback and user data */ 2001 pj_bzero(&tp_ice->cb, sizeof(tp_ice->cb)); 2002 tp_ice->base.user_data = NULL; 2003 tp_ice->rtp_cb = NULL; 2004 tp_ice->rtcp_cb = NULL; 2005 1975 2006 if (tp_ice->ice_st) { 2007 pj_grp_lock_t *grp_lock = pj_ice_strans_get_grp_lock(tp_ice->ice_st); 1976 2008 pj_ice_strans_destroy(tp_ice->ice_st); 1977 2009 tp_ice->ice_st = NULL; 1978 } 1979 1980 pj_pool_safe_release(&tp_ice->pool); 2010 pj_grp_lock_dec_ref(grp_lock); 2011 } else { 2012 tp_ice_on_destroy(tp); 2013 } 1981 2014 1982 2015 return PJ_SUCCESS; -
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r5562 r5604 863 863 pj_log_push_indent(); 864 864 865 /* Reset callback and user data */ 866 pj_bzero(&ice_st->cb, sizeof(ice_st->cb)); 867 ice_st->user_data = NULL; 868 865 869 pj_grp_lock_acquire(ice_st->grp_lock); 866 870 … … 955 959 unsigned i; 956 960 957 /* Ignore if init callback has been called */958 if (ice_st-> cb_called)961 /* Ignore if ICE is destroying or init callback has been called */ 962 if (ice_st->destroy_req || ice_st->cb_called) 959 963 return; 960 964
Note: See TracChangeset
for help on using the changeset viewer.