RE: [GD-Windows] Terminating a program
Brought to you by:
vexxed72
From: George G. <ge...@ba...> - 2005-08-01 19:35:06
|
While letting the OS (XP, 2000 or NT) clean up the process is generally quick, there are dangers with device states, as in your example with the sound. While the OS can enforce its own issues relatively well (memory heap, file handles, GDI handles, etc), resources allocated and configured by drivers are beyond the direct control of the kernel, and as such can very often be left in unstable states when an app is terminated. While I'm sure that programming instructors everywhere will grimace in pain, not cleaning up your memory allocations is acceptable in the manner that Jon suggested (ie, faster to let the OS do it than to walk through pages and pages of memory freeing all the small bits). However, my own experience is that it is very wise to clean up your devices before you close - for example, properly de-allocate and shut down DirectX or OpenGL, DirectSound/DirectShow, network resources, etc. Not doing so could certainly leave some PC's in a less than stable state. -- George. - George Geczy - Lead Programmer, BattleGoat Studios - www.supremeruler2010.com - "Designing the Next Generation of Intelligent Strategy Games" > Is it that true ? > > We have an game demo here on a PC that uses large > sound buffers. > When we kill the app using the task manager, and > launch once again the application, the framerate > become really slow, and we can't get any good > framerate but by booting the PC. [...] > > If you're on NT-based Windows, just killing the > > process will work. It's > > a real OS with a real kernel, so all resources will > > be magically > > released (barring any driver bugs, of course).(*) |