Changeset 10

Show
Ignore:
Timestamp:
08/11/07 21:55:23 (1 year ago)
Author:
sip
Message:

Fixed conference destruction

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • media/src/mcu.cpp

    r1 r10  
    193193int MCU::DeleteConference(int id) 
    194194{ 
    195         Log("-DeleteConference [%d]\n",id); 
    196  
    197         //Bloqueamos 
    198         pthread_mutex_lock(&mutex); 
    199  
    200         //SI no esta 
    201         if (lstConf.find(id)==lstConf.end()) 
     195        Log(">DeleteConference [%d]\n",id); 
     196 
     197        //Bloqueamos 
     198        pthread_mutex_lock(&mutex); 
     199 
     200        //Find conference 
     201        LstConference::iterator it = lstConf.find(id); 
     202 
     203        //Check if we found it or not 
     204        if (it==lstConf.end()) 
    202205        { 
    203206                //Desbloquamos el mutex 
     
    207210                return Error("Conferencia no encontrada [%d]\n",id); 
    208211        } 
    209  
    210         //La marcamos para borrar 
    211         lstConf[id].enabled = false; 
     212         
     213        //Get conference 
     214        MultiConf *conf = it->second.conf; 
     215 
     216        //Remove from list 
     217        lstConf.erase(it); 
    212218 
    213219        //Desbloquamos el mutex 
    214220        pthread_mutex_unlock(&mutex); 
    215221 
    216         //Y salimos 
     222        //End it 
     223        conf->End(); 
     224 
     225        //Delete conference 
     226        delete conf; 
     227 
     228        Log("<DeleteConference [%d]\n",id); 
     229 
     230        //Exit 
    217231        return true; 
    218232} 
  • media/src/multiconf.cpp

    r6 r10  
    137137        Participant *part = (*it).second;        
    138138 
     139        //Y lo quitamos del mapa 
     140        lstParticipants.erase(it); 
     141 
    139142        //Terminamos el audio y el video 
    140143        part->video.End(); 
     
    147150        //Lo borramos 
    148151        delete part; 
    149  
    150         //Y lo quitamos del mapa 
    151         lstParticipants.erase(it); 
    152152 
    153153        return 1; 
  • media/src/xmlrpcmcu.cpp

    r8 r10  
    9595        if(env->fault_occurred) 
    9696                return 0; 
    97           
    98         //Obtenemos la referencia 
    99         if(!mcu->GetConferenceRef(confId,&conf)) 
    100                 return xmlerror(env,"La conferencia no existe\n"); 
    101  
    102         //La borramos 
    103         int res = conf->End(); 
    104  
    105         //Liberamos la referencia 
    106         mcu->ReleaseConferenceRef(confId); 
    107  
    108         //Salimos 
    109         if(!res) 
    110                 return xmlerror(env,"No se ha podido terminar la conferencia\n"); 
     97 
     98        //Delete conference  
     99        if (!mcu->DeleteConference(confId)) 
     100                return xmlerror(env,"La conferencia no existe\n"); 
    111101 
    112102        //Devolvemos el resultado 
Copyright 2006 - Sergio García Murillo
Powered by Trac - Edgewall Software