From 7e56ccba1e40ffa6a2d55e67d7e86c4a63f62193 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 13 Oct 2001 16:59:03 +0000 Subject: [PATCH] When active input line was destroyed, irssi didn't set active_entry to NULL. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1823 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-entry.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 84a7cd7a..3af35eba 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -43,6 +43,9 @@ void gui_entry_destroy(GUI_ENTRY_REC *entry) { g_return_if_fail(entry != NULL); + if (active_entry == entry) + gui_entry_set_active(NULL); + g_free_not_null(entry->prompt); g_string_free(entry->text, TRUE); g_free(entry); @@ -148,9 +151,11 @@ void gui_entry_set_active(GUI_ENTRY_REC *entry) { active_entry = entry; - screen_move_cursor(entry->xpos + entry->scrpos + entry->promptlen, - entry->ypos); - screen_refresh(NULL); + if (entry != NULL) { + screen_move_cursor(entry->xpos + entry->scrpos + + entry->promptlen, entry->ypos); + screen_refresh(NULL); + } } void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str)