[Nautilus-list] patch : crash with dnd
- From: jacob berkman <jacob ximian com>
- To: Nautilus <nautilus-list lists eazel com>
- Subject: [Nautilus-list] patch : crash with dnd
- Date: 15 Feb 2002 13:12:11 -0500
gtk 2 is fixed wrt gtk_selection_data_copy and gtk_selection_data_free,
so when you drop an icon on nautilus 2 it double frees data->data.
this patch removes the eel selection functions as they are no longer
needed, and makes nautilus use the gtk calls.
jacob
--
Index: eel/eel/eel-gtk-extensions.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-gtk-extensions.c,v
retrieving revision 1.37
diff -u -r1.37 eel-gtk-extensions.c
--- eel/eel/eel-gtk-extensions.c 2002/02/06 20:34:07 1.37
+++ eel/eel/eel-gtk-extensions.c 2002/02/15 18:09:09
@@ -414,36 +414,6 @@
}
/**
- * eel_gtk_selection_data_copy_deep:
- *
- * Copies a GtkSelectionData, and copies the data too.
- * @data: The GtkSelectionData to be copied.
- **/
-GtkSelectionData *
-eel_gtk_selection_data_copy_deep (const GtkSelectionData *data)
-{
- GtkSelectionData *copy;
-
- copy = g_new0 (GtkSelectionData, 1);
- gtk_selection_data_set (copy, data->type, data->format, data->data, data->length);
-
- return copy;
-}
-
-/**
- * eel_gtk_selection_data_free_deep:
- *
- * Frees a GtkSelectionData, and frees the data too.
- * @data: The GtkSelectionData to be freed.
- **/
-void
-eel_gtk_selection_data_free_deep (GtkSelectionData *data)
-{
- g_free (data->data);
- gtk_selection_data_free (data);
-}
-
-/**
* eel_gtk_signal_connect_free_data:
*
* Function to displace the popup menu some, otherwise the first item
Index: eel/eel/eel-gtk-extensions.h
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-gtk-extensions.h,v
retrieving revision 1.19
diff -u -r1.19 eel-gtk-extensions.h
--- eel/eel/eel-gtk-extensions.h 2002/02/06 20:34:07 1.19
+++ eel/eel/eel-gtk-extensions.h 2002/02/15 18:09:09
@@ -116,9 +116,6 @@
GdkEventKey *event);
char* eel_gtk_window_get_geometry_string (GtkWindow *window);
-/* selection data */
-GtkSelectionData * eel_gtk_selection_data_copy_deep (const GtkSelectionData *selection_data);
-void eel_gtk_selection_data_free_deep (GtkSelectionData *selection_data);
/* GtkMenu and GtkMenuItem */
char * eel_truncate_text_for_menu_item (const char *text);
Index: nautilus/libnautilus-private/nautilus-icon-dnd.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-dnd.c,v
retrieving revision 1.107
diff -u -r1.107 nautilus-icon-dnd.c
--- nautilus/libnautilus-private/nautilus-icon-dnd.c 2002/02/05 19:22:51 1.107
+++ nautilus/libnautilus-private/nautilus-icon-dnd.c 2002/02/15 18:09:09
@@ -412,14 +412,14 @@
case NAUTILUS_RESET_BACKGROUND_ENUM:
/* Save the data so we can do the actual work on drop. */
g_assert (drag_info->selection_data == NULL);
- drag_info->selection_data = eel_gtk_selection_data_copy_deep (data);
+ drag_info->selection_data = gtk_selection_data_copy (data);
break;
/* Netscape keeps sending us the data, even though we accept the first drag */
case NAUTILUS_ICON_DND_URL:
if (drag_info->selection_data != NULL) {
- eel_gtk_selection_data_free_deep (drag_info->selection_data);
- drag_info->selection_data = eel_gtk_selection_data_copy_deep (data);
+ gtk_selection_data_free (drag_info->selection_data);
+ drag_info->selection_data = gtk_selection_data_copy (data);
}
break;
@@ -1187,7 +1187,7 @@
}
if (dnd_info->drag_info.selection_data != NULL) {
- eel_gtk_selection_data_free_deep (dnd_info->drag_info.selection_data);
+ gtk_selection_data_free (dnd_info->drag_info.selection_data);
dnd_info->drag_info.selection_data = NULL;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]