JohnOne Posted April 23, 2012 Share Posted April 23, 2012 (edited) When the function process close is used, does it clean up the resources of any child processeswhich might be owned by the passed process?I'm asking as I've been using Tesseract.exe, and making a number of calls to a function using itquite rapidly (usually between 6 and 12 calls) using ShellExecute. EDIT: ShellExecuteWaitAfter a few calls usually either 6,7 or 8 the process takes about 4 times the time to complete thanprevious calls, and I suspect some resources are not being cleaned up, so have been using ProcessClosein an attempt to release any memory or other resources after each call.These attempts as you might have gathered have not been successful.A bit more info... a usual call will take around 300 milliseconds, then the following one call might take 3000 milliseconds, or two calls will take 1500 milliseconds each, amounting to around 3000.EDIT: After that they go back to the normal 300 ms If I sleep 500 milliseconds between each call the are all around 300 milliseconds to complete.I'm after any suggestions of things to try. Edited April 23, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zedna Posted May 7, 2012 Share Posted May 7, 2012 According to AutoIt 3.1.0 sources ProcessClose uses TerminateProcess API functionhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms686714%28v=vs.85%29.aspxSee Remarks section ... I think it may be what you are after This function stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled. When a process terminates, its kernel object is not destroyed until all processes that have open handles to the process have released those handles.TerminateProcess is asynchronous; it initiates termination and returns immediately. If you need to be sure the process has terminated, call the WaitForSingleObject function with a handle to the process. JohnOne 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
JohnOne Posted May 7, 2012 Author Share Posted May 7, 2012 Thanks for the info Zedna, I'll look into that. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now