PDA

View Full Version : Program crash, when I close the OpenGL window



06-15-2005, 05:39 AM
I create a OpenGL window, which has the "normal Windows-XP red cross" on its upper right corner (to close/exit this window).

As soon as I do so, my programm crashes.
The same happens, when I want to close my program itself.

What can I do?

I tried exit(0); but sometimes it crashes also. I get this "do you want to send this error to microsoft" message then.

Any idea?

ZbuffeR
06-15-2005, 06:09 AM
Can you give more details on your program and hardware setup ? like video card, drivers, etc
Are you using GLUT, or win32 calls, or whatever else ?
How do you handle closing events ?

06-15-2005, 06:25 AM
I am using the following to get the thing running:

glutCreateWindow("Name");
glutMainLoop();

So I have a console-like windows (my application) and the OpenGL-window "Name" from above. Whatever I close -> Program crashes.

Aeluned
06-15-2005, 06:51 AM
Use a debugger.

There is little we can do to help with the little information you've provided.
A ton of things could be causing the crash.

ensure you aren't dereferencing an unitialized pointer, or deleting an already deleted pointer or...well, the list goes on and on.

evian
06-15-2005, 10:19 AM
Well, I am sure it has to do with glutMainLoop().
And so I hope, someone might have had the same problem.

I don`t have a problem to quit this application, when I did not turn OpenGL loose. As soon, as OpenGL is running, quiting does not work anymore.

Anyone an idea, better than "use a compiler, idiot" ?

Aeluned
06-15-2005, 12:03 PM
awe, I wasn't calling you an idiot :) .

I figured since you were devoloping the app you had access to some debuf/diagnostic tools...that would have been the easiest way to rectify the issue.

CWiC
06-16-2005, 05:19 AM
Do the program print some messages or show some dialog when it crashes? I think the best way in your case is comment out most of parts of OpenGL codes and try to find which part causes the problem at application exit. It seems like you have problems with memory access and youe data rewrite some memory area and destroy one or more pointers...