Menu

#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


Log in to post a comment.