Index: gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.286
diff -u -p -r1.286 gtkwidget.c
--- gtkwidget.c	2002/01/14 23:24:02	1.286
+++ gtkwidget.c	2002/01/17 22:21:59
@@ -5570,7 +5570,6 @@ gtk_widget_real_destroy (GtkObject *obje
   g_object_set_qdata (G_OBJECT (widget), quark_accel_closures, NULL);
 
   gtk_grab_remove (widget);
-  gtk_selection_remove_all (widget);
   
   g_object_unref (widget->style);
   widget->style = gtk_widget_get_default_style ();
@@ -5589,7 +5588,6 @@ gtk_widget_finalize (GObject *object)
   GtkAccessible *accessible;
   
   gtk_grab_remove (widget);
-  gtk_selection_remove_all (widget);
 
   g_object_unref (widget->style);
   widget->style = NULL;
@@ -5729,6 +5727,8 @@ gtk_widget_real_unrealize (GtkWidget *wi
       widget->window = NULL;
     }
 
+  gtk_selection_remove_all (widget);
+  
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
 }
 
Index: gtkselection.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkselection.c,v
retrieving revision 1.47
diff -u -p -r1.47 gtkselection.c
--- gtkselection.c	2002/01/08 00:04:54	1.47
+++ gtkselection.c	2002/01/17 22:21:59
@@ -102,7 +102,6 @@ struct _GtkIncrConversion 
 
 struct _GtkIncrInfo
 {
-  GtkWidget *widget;		/* Selection owner */
   GdkWindow *requestor;		/* Requestor window - we create a GdkWindow
 				   so we can receive events */
   GdkAtom    selection;		/* Selection we're sending */
@@ -547,19 +546,6 @@ gtk_selection_remove_all (GtkWidget *wid
   
   /* Remove pending requests/incrs for this widget */
   
-  tmp_list = current_incrs;
-  while (tmp_list)
-    {
-      next = tmp_list->next;
-      if (((GtkIncrInfo *)tmp_list->data)->widget == widget)
-	{
-	  current_incrs = g_list_remove_link (current_incrs, tmp_list);
-	  /* structure will be freed in timeout */
-	  g_list_free (tmp_list);
-	}
-      tmp_list = next;
-    }
-  
   tmp_list = current_retrievals;
   while (tmp_list)
     {
@@ -1056,8 +1042,9 @@ gtk_selection_request (GtkWidget *widget
     return FALSE;
   
   info = g_new (GtkIncrInfo, 1);
+
+  g_object_ref (widget);
   
-  info->widget = widget;
   info->selection = event->selection;
   info->num_incrs = 0;
   
@@ -1211,12 +1198,14 @@ gtk_selection_request (GtkWidget *widget
       gdk_selection_send_notify (event->requestor, event->selection, 
 				 event->target, event->property, event->time);
     }
-  
+
   if (info->num_incrs == 0)
     {
       g_free (info->conversions);
       g_free (info);
     }
+
+  g_object_unref (widget);
   
   return TRUE;
 }
