diff --git a/amiga/gui.c b/amiga/gui.c index c3a7424eb..4ae03b797 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4267,8 +4267,11 @@ static void gui_window_set_title(struct gui_window *g, const char *title) CLICKTAB_Labels, ~0, TAG_DONE); - SetClickTabNodeAttrs(node, TNA_Text, utf8title, - TNA_HintInfo, utf8title, + if(g->tabtitle) ami_utf8_free(g->tabtitle); + g->tabtitle = strdup(utf8title); + + SetClickTabNodeAttrs(node, TNA_Text, g->tabtitle, + TNA_HintInfo, g->tabtitle, TAG_DONE); RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS], @@ -4276,9 +4279,6 @@ static void gui_window_set_title(struct gui_window *g, const char *title) CLICKTAB_Labels, &g->shared->tab_list, TAG_DONE); - if(g->tabtitle) ami_utf8_free(g->tabtitle); - g->tabtitle = utf8title; - if(ClickTabBase->lib_Version < 53) RethinkLayout((struct Gadget *)g->shared->objects[GID_TABLAYOUT], g->shared->win, NULL, TRUE); @@ -4293,6 +4293,8 @@ static void gui_window_set_title(struct gui_window *g, const char *title) SetWindowTitles(g->shared->win, g->shared->wintitle, ami_gui_get_screen_title()); } } + + ami_utf8_free(utf8title); } static void ami_redraw_callback(void *p)