Results 1 to 7 of 7

Thread: Program crash, when I close the OpenGL window

  1. #1
    Guest

    Program crash, when I close the OpenGL window

    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?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Program crash, when I close the OpenGL window

    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 ?

  3. #3
    Guest

    Re: Program crash, when I close the OpenGL window

    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.

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: Program crash, when I close the OpenGL window

    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.

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    20

    Re: Program crash, when I close the OpenGL window

    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" ?

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: Program crash, when I close the OpenGL window

    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.

  7. #7
    Senior Member Regular Contributor
    Join Date
    Jan 2001
    Location
    Ukraine
    Posts
    101

    Re: Program crash, when I close the OpenGL window

    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...

Similar Threads

  1. close program and exit
    By trackin in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 08-05-2009, 04:11 AM
  2. Exit the Program when i close the last Window.
    By Bernardo Breder in forum OpenGL: Windows
    Replies: 3
    Last Post: 12-02-2008, 06:15 AM
  3. Close Program when click X on GLUT Window
    By shart75 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 11-19-2007, 07:59 AM
  4. OpenGL program crash
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-19-2005, 10:55 AM
  5. Error when I close the OpenGL window
    By in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 03-22-2005, 02:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean