Advertisement

Windows Crashes

Started by July 05, 2001 08:02 PM
2 comments, last by miles vignol 23 years, 7 months ago
Okay, so you''re programming along and you run your app, it crashes for some minor reason, then it fails to run again because something can''t initialize (because something was never un-initialized the prvious run). What do you do? Reboot? This happens to me with openAL and SDL. I think GLUT did it as well, but I''m not sure. The initializations for these programs fail when they aren''t exited cleanly. Isn''t that asking a bit much from a programmer to make sure the program always exits cleanly when it''s being developed? Is there some trick people employ when using a system like this? I noticed I could kill DDHELP.EXE and some times I could get things to run again. Is there some other program running that could be restarted to clear things up? Thanks for any pointers. Rebooting windows every third run is just a little silly in my book.
What version of Windows are you developing under?

The best advice I can give you, though it can be somewhat costly, is to buy a copy of Windows 2000 Professional if you are currently using 95/98/ME to develop. In general Win2000 is far more stable and has far less of these resource issues, as the OS is much better about really killing a process and freeing its resources (if it hasn''t done so itself) when the process is terminated.

In any case, when your program allocates resources, whether they be OS handles, handles into other APIs, or whatever, its usually a good idea to write the cleanup code at the same time or soon after the init code. Waiting until some theoretical later point to worry about cleanup usually results in problems like those you described which complicate the development process..and also later when its time to deal with these issues you spend much more time than you would have matching up your allocations to your frees than you would if you wrote the code for both during the same timeframe. All IMO.
Advertisement
I''m developing under 95/98. The problem is when the program crashes it doesn''t get to the clean-up code. The unfortunate crashes I''m experiencing now are proving to be very difficult to trace so I''m having to iterate and test a lot.

If I develop under windows 2000 pro, can I compile for execution under 95/98 or only for 2000?
Just use exceptions and it won''t crash again
(you can find me on IRC : #opengl on undernet)

This topic is closed to new replies.

Advertisement