|
|
@ -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
|
|
|
|