Re: Updated unexpected window destruction patch.




Owen Taylor <otaylor@redhat.com> writes:

> int error_handler (Display *d, XErrorEvent *e)
> {
>   if ((e->error_code == BadWindow) || (e->error_code == BadDrawable))
>     {
>       GdkWindow *window = gdk_window_lookup (e->resourceid);
> 
>       if (window)
> 	{
> 	  if (!g_dataset_get_data (window, "bonobo-error"))
> 	    {
> 	      g_dataset_set_data_full (window, "bonobo-error",
> 				       g_new (gint, 1),
> 				       (GDestroyNotify)g_free);

Tim pointed out to me that using g_dataset_* directly here
is broken. I forgot that I had added accessors for 
drawable data. So this should be:

 gdk_drawable_set_data (window, "bonobo-error",
                        g_new (gint, 1), (GDestroyNotify)g_free);

So, if you use this technique, do it that way,

                                        Owen



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