Re: Win32lib: ExitProcess
- Posted by Robert Craig <rds at RapidEuphoria.com> Jul 15, 2002
- 390 views
Don Phillips writes: > Hey Derek. I am almost sure that this call is not really needed. > Mostly it just unloads the linked DLLs and frees some Windows management > memory. However, since it is technically Euphoria that is doing the > loading of all these objects, I think these things will be cleared up > automatically anyways as soon as Euphoria itself terminates... ( I think). Someone pointed out to me (Euman? Derek?) a long time ago that a small amount of space reserved for loaded .dll's was not being freed when Euphoria for Windows terminated. ExitProcess() frees these .dlls, so I started to use it in my local version of exw.exe. I discovered however (before releasing 2.3) that although ExitProcesss unloads the .dlls, it *doesn't* flush regular files that were written-to but never closed or flushed by the Euphoria program. This is something that the normal C exit() *does* do, and I'd like Euphoria users to be able to count on it. So I went back to using exit(), but I now keep track of all the loaded .dll's and I free them with FreeLibrary() at the end - see Cleanup() in runtime.c in the Euphoria source. Cleanup also outputs the profiling information, displays warning messages, and a few other minor things. So I think it's better that Win32Lib not call ExitProcess(), but if there's any other cleanup that we are now going to miss, I'd like to know about it. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com