Don't accept n_targets == -1. (clipboard_unset): unref the old_data, not

2005-03-30  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkclipboard.c (gtk_clipboard_set_can_store):
	Don't accept n_targets == -1.
	(clipboard_unset): unref the old_data, not the
	user_data which we have just cleared.  (#172038, Sven
	Neumann)
This commit is contained in:
Matthias Clasen 2005-03-30 17:37:42 +00:00 committed by Matthias Clasen
parent 118003400a
commit dd58d23390
4 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,11 @@
2005-03-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_set_can_store):
Don't accept n_targets == -1.
(clipboard_unset): unref the old_data, not the
user_data which we have just cleared. (#172038, Sven
Neumann)
* gtk/gtkcombobox.c (gtk_combo_box_popup): Don't
segfault if somebody tries to popup an unrealized
combo box. (#172031, Felipe Heidrich)

View File

@ -1,5 +1,11 @@
2005-03-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_set_can_store):
Don't accept n_targets == -1.
(clipboard_unset): unref the old_data, not the
user_data which we have just cleared. (#172038, Sven
Neumann)
* gtk/gtkcombobox.c (gtk_combo_box_popup): Don't
segfault if somebody tries to popup an unrealized
combo box. (#172031, Felipe Heidrich)

View File

@ -1,5 +1,11 @@
2005-03-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_set_can_store):
Don't accept n_targets == -1.
(clipboard_unset): unref the old_data, not the
user_data which we have just cleared. (#172038, Sven
Neumann)
* gtk/gtkcombobox.c (gtk_combo_box_popup): Don't
segfault if somebody tries to popup an unrealized
combo box. (#172031, Felipe Heidrich)

View File

@ -678,7 +678,7 @@ clipboard_unset (GtkClipboard *clipboard)
*/
if (old_have_owner &&
old_n_storable_targets != -1)
g_object_unref (clipboard->user_data);
g_object_unref (old_data);
}
/**
@ -1609,6 +1609,7 @@ gtk_clipboard_set_can_store (GtkClipboard *clipboard,
};
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (n_targets >= 0);
if (clipboard->selection != GDK_SELECTION_CLIPBOARD)
return;