Query gtk_drag_dest_set_target_list typo



Hi,

I feel a bit reluctant to bring to your attention any errors I find
after my last mistake, but I was very TIRED at the time. My apologies! 

I noticed in the following function from gtkdnd.c that site->target_list
is ref'ed and immediatley unref'ed again. Should the first call to
gtk_target_list_ref refer target_list instead of site->target_list;

void
gtk_drag_dest_set_target_list (GtkWidget      *widget,
                               GtkTargetList  *target_list)
{
  GtkDragDestSite *site;
  
  site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
  
  if (site == NULL)
    {
      g_warning ("can't set a target list on a widget until you've
called gtk_drag_dest_set() to make the widget into a drag destination");
      return;
    }

  if (target_list)
    gtk_target_list_ref (site->target_list);
  
  if (site->target_list)
    gtk_target_list_unref (site->target_list);

  site->target_list = target_list;
}


Thanks,

Jeff.




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