Re: [AD] X error workaround

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2002-01-23, Lo'oRiS il Kabukimono <_lano_@xxxxxxxxxx> wrote:
> I often have this error message when exiting from an Allegro program
> under X:
> 
> XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0.0"
>       after 7413 requests (7412 known processed) with 0 events
> remaining.
> 
> and after that the program doesn't do anything, but can exit with ^C.

It's a known bug.  It's a race condition.  Changing
`_xwin_close_display' (in src/x/xwin.c) to this seems to fix it.


void _xwin_close_display(void)
{
   Display *dpy;

   if (!_unix_bg_man->multi_threaded) {
      XLOCK();
   }

   if (_xwin.display != 0) {
      _xwin_destroy_window();
      dpy = _xwin.display;
      _xwin.display = 0;
      XCloseDisplay(dpy);
   }
      
   if (!_unix_bg_man->multi_threaded) {
      XUNLOCK();
   }
}


Someone else should commit it, after some testing.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/