mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Use a while loop instead of a for loop. Makes it easier to erase an element.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6243 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
51ad0ec92f
commit
fa504a8603
@ -1,3 +1,8 @@
|
||||
2003-02-25 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* forkedcontr.C (timer): Use a while loop rather than for; makes it
|
||||
easier to erase an element.
|
||||
|
||||
2003-02-25 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
* forkedcontr.C (timer): don't start a running timer.
|
||||
@ -6,7 +11,6 @@
|
||||
|
||||
* filetools.C (PutEnv): removed (unused)
|
||||
|
||||
|
||||
2003-02-17 John Levon <levon@movementarian.org>
|
||||
|
||||
* forkedcall.h:
|
||||
|
@ -83,8 +83,9 @@ void ForkedcallsController::timer()
|
||||
{
|
||||
ListType::size_type start_size = forkedCalls.size();
|
||||
|
||||
for (ListType::iterator it = forkedCalls.begin();
|
||||
it != forkedCalls.end(); ++it) {
|
||||
ListType::iterator it = forkedCalls.begin();
|
||||
ListType::iterator end = forkedCalls.end();
|
||||
while (it != end) {
|
||||
ForkedProcess * actCall = *it;
|
||||
|
||||
pid_t pid = actCall->pid();
|
||||
@ -133,12 +134,10 @@ void ForkedcallsController::timer()
|
||||
// Emit signal and remove the item from the list
|
||||
actCall->emitSignal();
|
||||
delete actCall;
|
||||
// erase returns the next iterator, so decrement it
|
||||
// to continue the loop.
|
||||
ListType::iterator prev = it;
|
||||
--prev;
|
||||
forkedCalls.erase(it);
|
||||
it = prev;
|
||||
// erase returns the next element in the list
|
||||
it = forkedCalls.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user