Browse Source

Don't need to de-iteratorize this one

Michael Hansen 14 years ago
parent
commit
07ecb7d616
  1. 17
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp

17
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp

@ -227,12 +227,11 @@ plAGChannel * plAGModifier::MergeChannel(plAGApplicator *app,
// DETACHCHANNEL // DETACHCHANNEL
hsBool plAGModifier::DetachChannel(plAGChannel * channel) hsBool plAGModifier::DetachChannel(plAGChannel * channel)
{ {
size_t i = 0; plAppTable::iterator i = fApps.begin();
hsBool done = false;
for( ; i != fApps.size(); i++) while( i != fApps.end() )
{ {
plAGApplicator *app = fApps[i]; plAGApplicator *app = *i;
plAGChannel *existingChannel = app->GetChannel(); plAGChannel *existingChannel = app->GetChannel();
if(existingChannel) if(existingChannel)
{ {
@ -243,16 +242,16 @@ hsBool plAGModifier::DetachChannel(plAGChannel * channel)
app->SetChannel(replacementChannel); app->SetChannel(replacementChannel);
if( ! replacementChannel && app->AutoDelete()) if( ! replacementChannel && app->AutoDelete())
{ {
fApps.erase(fApps.begin()+i); // Don't need to adjust the iterator since we're about to exit the loop
i--; fApps.erase(i);
delete app; delete app;
} }
done = true; return true;
break;
} }
} }
++i;
} }
return done; return false;
} }
// READ // READ

Loading…
Cancel
Save