Re: missing g_signal macros



Sven Neumann <sven gimp org> writes:

> Hi,
> 
> we started to port Gimp to the GLib/GTK+-2.0 API and I found myself
> using the generic (and lenghty) g_signal funcs very often. I'd vote 
> for including the following convenience macros:
> 
>  g_signal_connect_after()

No real opinion on this one.
  
>  g_signal_handlers_disconnect_by_data()
> 
>  g_signal_handlers_block_by_data()
>  g_signal_handlers_unblock_by_data()
> 
> If this is OK for you, I can provide the necessary simple patch.

Tim specifically did not want to add these and I tend to agree
with him... if you call g_signal_handlers_disconnect_by_data()
and you can't be absolutely sure that no one else has a pointer
to the data you are disconnecting, then your code has a 
latent bug in it.

It's almost always safer to disconnect only the signals
you know you connected with disconnect_by_func().

Regards,
                                        Owen




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