This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Ghost process


Hello. I am trying to teach myself basic Open GL programming (using the C
language) and I've run into an annoying problem. Consider the following
simple Open GL-program.

/* simple1_1.c */

#include <GL/glut.h>

void display()
{
   glClear( GL_COLOR_BUFFER_BIT );

   glBegin( GL_POLYGON );
   glVertex2f( -0.5, -0.5 );
   glVertex2f( -0.5, 0.5 );
   glVertex2f( 0.5, 0.5 );
   glVertex2f( 0.5, -0.5 );
   glEnd();

   glFlush();
}

int main( int argc, char** argv )
{
   glutInit( &argc, argv );
   glutCreateWindow( "simple 1-1" );
   glutDisplayFunc( display );
   glutMainLoop();

   return 0;
}

I compile this program using gcc:
gcc -g -Wall -o simple1_1 simple1_1.c -lopengl32 -lglu32 -lglut32

It compiles and links without errors, and when I run it it works as
intended. However, there is one annoying problem. If I close the program by
pressing the little x-button in the upper right corner, it's not terminated
properly. I noticed this when I ran the program, closed it and made some
changes to the code. When I tried to compile&link an executable couldn't be
created because simple1_1.exe was already in use. I fired up the task
manager and found simple1_1.exe in the list of processes and had to
terminate there. So, by just pressing the close-button doesn't terminate the
program properly, but leaves a ghost process.

My question is: Why does it leave a "ghost process" and how do make it not
do that?

// Mikael



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]