Alfredo Braunstein wrote:
> Jean-Marc Lasgouttes wrote:
>
>> Could you try to provide a fix for 1.3.x?
>>
>> JMarc
>
> How can I do that? I would have to get the whole 1.3 tree?
>
> I suspect that it's simple to replace ForkedcallsControler::time
> with its cvs HEAD version. Angus, am I right?
>
> Alfredo
Dunno. I have only 1.3.x here. You can dig out the bit you think
needs fixing like so and get JMarc to test it ;-)
Angus
$ cvs -d :ext:[EMAIL PROTECTED]:/usr/local/lyx/cvsroot
checkout -d 13xsupport -rBRANCH_1_3_X lyx-devel/src/support
$
$ cvs -d :ext:[EMAIL PROTECTED]:/usr/local/lyx/cvsroot
checkout -d 14xsupport lyx-devel/src/support
$
$ diff -u 13xsupport/forkedcontr.C 14xsupport/.
--- 13xsupport/forkedcontr.C Tue Feb 25 16:53:24 2003
+++ 14xsupport/./forkedcontr.C Tue Feb 25 19:12:05 2003
@@ -14,10 +14,6 @@
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "forkedcontr.h"
#include "forkedcall.h"
#include "lyxfunctional.h"
@@ -87,8 +83,9 @@
{
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();
@@ -106,7 +103,6 @@
} else if (waitrpid == 0) {
// Still running. Move on to the next child.
- continue;
} else if (WIFEXITED(stat_loc)) {
// Ok, the return value goes into retval.
@@ -134,15 +130,17 @@
}
if (remove_it) {
- // Emit signal and remove the item from the
list
+ forkedCalls.erase(it);
+
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;
+
+ /* start all over: emiting the signal can
result
+ * in changing the list (Ab)
+ */
+ it = forkedCalls.begin();
+ } else {
+ ++it;
}
}