Disconnect idle handlers on destroy to avoid problems when they are called

2005-09-02  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c (gtk_entry_destroy): Disconnect idle handlers
	on destroy to avoid problems when they are called on a destroyed
	widget.  (#315135, John Cupitt)
This commit is contained in:
Matthias Clasen 2005-09-02 19:48:53 +00:00 committed by Matthias Clasen
parent ade8ec4c4e
commit a809ae2a81
3 changed files with 22 additions and 2 deletions

View File

@ -1,6 +1,10 @@
2005-09-02 Matthias Clasen <mclasen@redhat.com> 2005-09-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_class_init): * gtk/gtkentry.c (gtk_entry_destroy): Disconnect idle handlers
on destroy to avoid problems when they are called on a destroyed
widget. (#315135, John Cupitt)
* gtk/gtkentry.c (gtk_entry_class_init):
* gtk/gtktextview.c (gtk_text_view_class_init): Add bindings * gtk/gtktextview.c (gtk_text_view_class_init): Add bindings
for Ctrl-Shift-A to unselect all. (#309301, Kathy Fernandes) for Ctrl-Shift-A to unselect all. (#309301, Kathy Fernandes)

View File

@ -1,6 +1,10 @@
2005-09-02 Matthias Clasen <mclasen@redhat.com> 2005-09-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_class_init): * gtk/gtkentry.c (gtk_entry_destroy): Disconnect idle handlers
on destroy to avoid problems when they are called on a destroyed
widget. (#315135, John Cupitt)
* gtk/gtkentry.c (gtk_entry_class_init):
* gtk/gtktextview.c (gtk_text_view_class_init): Add bindings * gtk/gtktextview.c (gtk_text_view_class_init): Add bindings
for Ctrl-Shift-A to unselect all. (#309301, Kathy Fernandes) for Ctrl-Shift-A to unselect all. (#309301, Kathy Fernandes)

View File

@ -1071,6 +1071,18 @@ gtk_entry_destroy (GtkObject *object)
gtk_entry_reset_im_context (entry); gtk_entry_reset_im_context (entry);
gtk_entry_reset_layout (entry); gtk_entry_reset_layout (entry);
if (entry->blink_timeout)
{
g_source_remove (entry->blink_timeout);
entry->blink_timeout = 0;
}
if (entry->recompute_idle)
{
g_source_remove (entry->recompute_idle);
entry->recompute_idle = 0;
}
if (!entry->visible) if (!entry->visible)
{ {
/* We want to trash the text here because the entry might be leaked. */ /* We want to trash the text here because the entry might be leaked. */