I have an application that launches a completely separate 64-bit Intel Fortran EXE and waits for it to complete before taking control again. It all works well except that after the Fortran EXE has finished, it stays in the Windows Task Manager with a status of "Terminated" for about 30 seconds before it finally disappears completely.
The problem is that If my application tries to re-launch it while it is still in this "Terminated" state it has problems because it still seems to have files open from the previous launch even though they were all closed properly. If I do the re-launch after it has disappeared from task manager then all is well. I assume that it is still flushing buffers and whatnot while it is in the "Terminated" state even though it looks like it has ended.
Is there anything I can do to make it disappear from task manager as soon as it finishes rather than going into this limbo state for 30 seconds? If it is flushing buffers can I turn this behaviour off?