quartz: really don't call a NULL function in gtk_clipboard_store()
Need to check targets and get_func in each loop iteration because calling get_func the fist time might do whatever to the clipboard. Re-fixes bug #626499. Also free the target table after we're done.
This commit is contained in:
committed by
Michael Natterer
parent
f895cd44af
commit
bc3f1893aa
@@ -1063,6 +1063,13 @@ gtk_clipboard_store (GtkClipboard *clipboard)
|
||||
{
|
||||
GtkSelectionData selection_data;
|
||||
|
||||
/* in each loop iteration, check if the content is still
|
||||
* there, because calling get_func() can do anything to
|
||||
* the clipboard
|
||||
*/
|
||||
if (!clipboard->target_list || !clipboard->get_func)
|
||||
break;
|
||||
|
||||
memset (&selection_data, 0, sizeof (GtkSelectionData));
|
||||
|
||||
selection_data.selection = clipboard->selection;
|
||||
@@ -1079,6 +1086,9 @@ gtk_clipboard_store (GtkClipboard *clipboard)
|
||||
|
||||
g_free (selection_data.data);
|
||||
}
|
||||
|
||||
if (targets)
|
||||
gtk_target_table_free (targets, n_targets);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user