Message-ID: From: Shawn Hargreaves To: Eli Zaretskii , djgpp-workers AT delorie DOT com Cc: Shawn Hargreaves Subject: RE: exit() makes my program crash!!!! (FINAL comment) (fwd) Date: Mon, 18 Oct 1999 09:26:24 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii writes: > Regarding the one below: is it a good idea to add code to the exit > code that switches the display to mode 3 (after v2.03 is released)? I would say not: IMHO it is the responsibility of whoever changed the video mode to put it back when they are done. For instance Allegro does try to do this automatically, hooking into atexit() and various signal handlers to deal with abnormal terminations, but I don't think this code belongs in libc. One practical consideration is that it can be surprisingly hard to correctly reset the mode, as a simple BIOS call is often not sufficient for this. I've found several buggy VESA implementations that are unable to select a text mode directly after using a truecolor SVGA resolution, so you have to use a VESA call to select a 640x480x8 mode, and then go from there to mode 3. Also, if the program is using more unusual video systems like a VBE/AF hardware accelerator driver, it may be left in an unusable state unless that system is closed down gracefully (waiting for accelerator idle, disabling the linear framebuffer, etc). > Do other DOS compilers do that? Not that I'm aware of. Shawn Hargreaves.