Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#194 RTP Stack: DestinationListHandler::removeDestinationFromList

open
nobody
None
5
2012-11-20
2004-08-03
aLeXx
No

From outqueue.cpp:
original code
while ( NULL != ta ) {
if ( ia == ta->getNetworkAddress() &&
dataPort == ta->getDataTransportPort() &&
controlPort == ta->getControlTransportPort() ) {
// matches. -> remove it.
result = true;
if ( prev )
prev->setNext(ta->getNext());
destinationCounter--;
delete ta;
} else {
prev = ta;
ta = ta->getNext();
}
}
must be like that
while ( NULL != ta ) {
if ( ia == ta->getNetworkAddress() &&
dataPort == ta->getDataTransportPort() &&
controlPort == ta->getControlTransportPort() ) {
// matches. -> remove it.
result = true;
if ( prev )
prev->setNext(ta->getNext());
destinationCounter--;
TransportAddress* tn = ta->getNext();
if(firstDestination == ta)
firstDestination = tn;
else if(lastDestination == ta)
lastDestination = prev;
delete ta;
ta = tn;
} else {
prev = ta;
ta = ta->getNext();
}
}

Discussion