On Thursday 20 September 2001 05:48 pm, Greg Stein wrote: > On Thu, Sep 20, 2001 at 11:18:55AM -0700, Aaron Bannert wrote: > >... > > Does this fix it for you? All testmem tests passed for me and your code > > above properly flushes "Cleanup" to the file. > > > > (Someone needs to check my work on run_child_cleanups() and make sure > > that the popping is necessary. It looked to be in the same situation.) > > Calling pop_cleanup() on every iteration is a bit much. Consider the > following patch: > > while ((c = p->cleanups) != NULL) { > p->cleanups = NULL; > run_cleanups(c); > } > > You don't even have to change run_cleanups or run_child_cleanups. > > Basically, the above code processes the cleanups in batches. Everything > that was initially registered is processed, then everything registerd > during the first cleanup round, etc. > > It does not maintain the LIFO behavior where cleanup A registers cleanup B > and expects B to run *just after* cleanup A finishes. If A wanted that, > then it could just calll B. But the most important part: all cleanups *do* > get run.
You've got to keep the LIFO behavior, or the kind of problems you posted about yesterday are more likely. Ryan ______________________________________________________________ Ryan Bloom [EMAIL PROTECTED] Covalent Technologies [EMAIL PROTECTED] --------------------------------------------------------------