]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
added rsession check before comparing its state. commented out active sessions loop
authorWilliam King <william.king@quentustech.com>
Wed, 6 Mar 2013 20:13:10 +0000 (12:13 -0800)
committerWilliam King <william.king@quentustech.com>
Wed, 24 Apr 2013 00:48:07 +0000 (17:48 -0700)
src/mod/endpoints/mod_rtmp/mod_rtmp.c

index bfe09a27f6ab95ead7b2789c350379c47b4fd3a0..d43ba425debc2ae8f2bb0099bf03fc3bf33dac87 100644 (file)
@@ -228,7 +228,6 @@ switch_status_t rtmp_on_destroy(switch_core_session_t *session)
        tech_pvt = switch_core_session_get_private(session);
 
        if (tech_pvt) {
-               rtmp_session_t *rsession = tech_pvt->rtmp_session;
                if (switch_core_codec_ready(&tech_pvt->read_codec)) {
                        switch_core_codec_destroy(&tech_pvt->read_codec);
                }
@@ -240,8 +239,11 @@ switch_status_t rtmp_on_destroy(switch_core_session_t *session)
                switch_buffer_destroy(&tech_pvt->readbuf);
                switch_core_timer_destroy(&tech_pvt->timer);
 
-               if (rsession->state != RS_DESTROY) {
-                       rtmp_session_destroy(&rsession);
+               if (tech_pvt->rtmp_session) {
+                       rtmp_session_t *rsession = tech_pvt->rtmp_session;
+                       if (rsession->state != RS_DESTROY) {
+                               rtmp_session_destroy(&rsession);
+                       } 
                }
        }
 
@@ -845,10 +847,10 @@ switch_status_t rtmp_session_destroy(rtmp_session_t **rsession)
        }
        switch_thread_rwlock_unlock((*rsession)->session_rwlock);
        
-       while ((*rsession)->active_sessions > 0) {
+       /*      while ((*rsession)->active_sessions > 0) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Still have %d sessions, waiting\n", (*rsession)->active_sessions);
                switch_yield(500000);
-       }
+               }*/
        
        switch_thread_rwlock_wrlock((*rsession)->rwlock);
        switch_thread_rwlock_unlock((*rsession)->rwlock);