[comp.windows.x] XtRemoveInput in X11R4 is broken

net@tub.UUCP (Oliver Laumann) (02/15/90)

The following program (when compiled under X11R4) dumps core in
XtRemoveInput():

   main () {
       XtAppContext c;
       XtInputId i;
   
       XtToolkitInitialize ();
       c = XtCreateApplicationContext ();
       i = XtAppAddInput (c, 1, XtInputWriteMask, main, 0);
       XtRemoveInput (i);
   }

It works fine when XtInputReadMask is used instead of XtInputWriteMask.
In general, XtRemoveInput seems to dump core when a data sink is
registered, but no data source has been registered yet in the same
application context. 

In this case, the queue holding the data sources (selectRqueue) is not
allocated, but it is searched in XtRemoveInput.

I assume no-one has ever tried to register an "input" source with
XtInputWriteMask, otherwise this bug wouldn't have survived until X11R4...

Regards,
--
Oliver Laumann     net@TUB.BITNET     net@tub.cs.tu-berlin.de     net@tub.UUCP