diff options
-rw-r--r-- | gtk/gtkpasswordentry.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 5fe1346dd6..b540a27fca 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -251,12 +251,23 @@ gtk_password_entry_realize (GtkWidget *widget) } static void -gtk_password_entry_dispose (GObject *object) +gtk_password_entry_unrealize (GtkWidget *widget) { - GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object); + GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget); if (entry->keyboard) - g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry); + { + g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry); + entry->keyboard = NULL; + } + + GTK_WIDGET_CLASS (gtk_password_entry_parent_class)->unrealize (widget); +} + +static void +gtk_password_entry_dispose (GObject *object) +{ + GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object); if (entry->entry) gtk_editable_finish_delegate (GTK_EDITABLE (entry)); @@ -448,6 +459,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass) object_class->set_property = gtk_password_entry_set_property; widget_class->realize = gtk_password_entry_realize; + widget_class->unrealize = gtk_password_entry_unrealize; widget_class->measure = gtk_password_entry_measure; widget_class->size_allocate = gtk_password_entry_size_allocate; widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate; |