diff options
Diffstat (limited to 'src/tab-label.c')
-rw-r--r-- | src/tab-label.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index 4b28923..35f1c91 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -192,12 +192,7 @@ set_title(MqTabLabel *tab_label, const gchar *title) g_free(tab_label->title); tab_label->title = g_strdup(title); if (tab_label->scrolling) { - g_free(tab_label->scrolled_title); - g_free(tab_label->scrolled_markup); - tab_label->scrolled_title = g_strdup_printf("%s ", title); - tab_label->scrolled_markup = - g_markup_printf_escaped(SCROLLED_TITLE_FMT, - tab_label->scrolled_title); + mq_tab_label_begin_scrolling(tab_label); } update_label(tab_label); gtk_widget_set_tooltip_text(GTK_WIDGET(tab_label), tab_label->title); @@ -513,13 +508,9 @@ mq_tab_label_set_position(MqTabLabel *tab_label, guint position) void mq_tab_label_begin_scrolling(MqTabLabel *tab_label) { - if (tab_label->scrolling) { - /* Avoid leaking tab_label->scrolled_title and - * tab_label->scrolled_markup. */ - return; - } - tab_label->scrolling = TRUE; + g_free(tab_label->scrolled_title); + g_free(tab_label->scrolled_markup); tab_label->scrolled_title = g_strdup_printf("%s ", tab_label->title); tab_label->scrolled_markup = g_markup_printf_escaped(SCROLLED_TITLE_FMT, tab_label->scrolled_title); |