Source/ThunderBeast/QuakeToonProto1/linux/rw_x11.c
void SWimp_Shutdown( void )
{
	int i;

	if (!X11_active)
		return;

	if (doShm) {
		for (i = 0; i < 2; i++)
			if (x_framebuffer[i]) {
				XShmDetach(dpy, &x_shminfo[i]);
				free(x_framebuffer[i]);
				shmdt(x_shminfo[i].shmaddr);
				x_framebuffer[i] = NULL;
			}
	} else if (x_framebuffer[0]) {
		free(x_framebuffer[0]->data);
		free(x_framebuffer[0]);
		x_framebuffer[0] = NULL;
	}

	XDestroyWindow(	dpy, win );

//	XAutoRepeatOn(dpy);
//	XCloseDisplay(dpy);

	X11_active = false;
}
/*
** SWimp_Shutdown
**
** System specific graphics subsystem shutdown routine.  Destroys
** DIBs or DDRAW surfaces as appropriate.
*/
SWimp_Shutdown
System specific graphics subsystem shutdown routine.  Destroys
DIBs or DDRAW surfaces as appropriate.
SWimp_Shutdown System specific graphics subsystem shutdown routine . Destroys DIBs or DDRAW surfaces as appropriate .
void SWimp_Shutdown( void )
{
	int i;
	if (!X11_active)
		return;
	if (doShm) {
		for (i = 0; i < 2; i++)
			if (x_framebuffer[i]) {
				XShmDetach(dpy, &x_shminfo[i]);
				free(x_framebuffer[i]);
				shmdt(x_shminfo[i].shmaddr);
				x_framebuffer[i] = NULL;
			}
	} else if (x_framebuffer[0]) {
		free(x_framebuffer[0]->data);
		free(x_framebuffer[0]);
		x_framebuffer[0] = NULL;
	}
	XDestroyWindow(	dpy, win );
	X11_active = false;
}
void SWimp_Shutdown ( void ) { int i ; if ( ! X11_active ) return ; if ( doShm ) { for ( i = 0 ; i < 2 ; i ++ ) if ( x_framebuffer [ i ] ) { XShmDetach ( dpy , & x_shminfo [ i ] ) ; free ( x_framebuffer [ i ] ) ; shmdt ( x_shminfo [ i ] . shmaddr ) ; x_framebuffer [ i ] = NULL ; } } else if ( x_framebuffer [ 0 ] ) { free ( x_framebuffer [ 0 ] -> data ) ; free ( x_framebuffer [ 0 ] ) ; x_framebuffer [ 0 ] = NULL ; } XDestroyWindow ( dpy , win ) ; X11_active = false ; }
SWimp_Shutdown
System specific graphics subsystem shutdown routine.
SWimp_Shutdown System specific graphics subsystem shutdown routine .
//	XAutoRepeatOn(dpy); //	XCloseDisplay(dpy);