Re: GdkInput list not modifiable from GdkInput->function




Jan Kratochvil <short@ucw.cz> writes:

> --dtB3X0nJg68CQEui
> Content-Type: text/plain; charset=us-ascii
> 
> Hi
> 
>   There is a strong disadvantage in current GTK1.0 releases (upto current 1.0.6)
> that handler of GdkInput is not allowed to modify GdkInput handlers list
> as otherwise list/memory corruption can occur. Under GTK1.1 it appears OK now as
> the whole GdkInput system has been rewritten.
>   This is a major fault as there is no way to register/unregister new GdkInputs
> otherway. Maybe doing gtk_main_quit() and restarting gtk_main after each event
> but as I remember it had some disadvantage (not sure for now). This patch was
> written more than a year ago, see the timestamp :-) , but unfortunately it
> has somehow lost between.
>   This patch has only A LITTLE performance cost as the GdkInput handlers list is
> copied before the processing starts.

First off, I rather doubt we'll make any more GTK+-1.0 releases,
so however it works now, it will work forever.

In GTK+-1.0 you can not may arbitrary modifications to
the input handler list, but you can safely:

 - Remove an input from within itself
 - Add new input handlers from within an input handler

The only unsafe thing to do is to remove one input handler from
within another.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]