Bug 653450 - gtkfilechooser crashes when added favorite
Ensure that display is set during drag-and-drop, and that string lists' memory is zeroed after allocation to prevent g_strfreev() from over-running.
This commit is contained in:
parent
10352d63af
commit
94fc15ad95
3 changed files with 4 additions and 4 deletions
|
|
@ -179,10 +179,8 @@ make_list (const gchar *text,
|
|||
}
|
||||
|
||||
if (list)
|
||||
*list = g_new (gchar *, n_strings + 1);
|
||||
*list = g_new0 (gchar *, n_strings + 1);
|
||||
|
||||
(*list)[n_strings] = NULL;
|
||||
|
||||
i = n_strings;
|
||||
tmp_list = strings;
|
||||
while (tmp_list)
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ struct _GtkDragFindData
|
|||
selection_data.data = NULL;
|
||||
selection_data.length = -1;
|
||||
selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
|
||||
selection_data.display = gdk_display_get_default ();
|
||||
|
||||
if (gtk_target_list_find (info->target_list,
|
||||
selection_data.target,
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
|
|||
selection_data = g_slice_new0 (GtkSelectionData);
|
||||
selection_data->selection = selection;
|
||||
selection_data->target = target;
|
||||
|
||||
if (!selection_data->display)
|
||||
selection_data->display = gdk_display_get_default ();
|
||||
if (target == gdk_atom_intern_static_string ("UTF8_STRING"))
|
||||
{
|
||||
NSString *s = [pasteboard stringForType:NSStringPboardType];
|
||||
|
|
|
|||
Loading…
Reference in a new issue