RE: Terminating a program

"George Geczy" <[email protected]> Mon, 1 Aug 2005 14:34:35 -0400
Newsgroups gmane.games.devel.windows
Message-ID <071901c596c7$ab027350$6400a8c0@georgedevxp>
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).(*)



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555