summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-17 22:15:03 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-17 22:15:03 +0000
commitc17ff1e9aeab9a2f078af06d524552b872a20558 (patch)
treee5391d092633d506736d959cd2a9f72048107c22 /amiga/gui.c
parent1fedc6a36a6d691962227a6432c68bfe297a0bd2 (diff)
downloadnetsurf-c17ff1e9aeab9a2f078af06d524552b872a20558.tar.gz
netsurf-c17ff1e9aeab9a2f078af06d524552b872a20558.tar.bz2
Squash memory leak and an offset problem related to helphints
svn path=/trunk/netsurf/; revision=10137
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 34a9f8a45..33d032b5f 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2928,12 +2928,15 @@ void gui_window_destroy(struct gui_window *g)
if(g->shared->tabs == 1)
ami_toggletabbar(g->shared, false);
+ ami_utf8_free(g->tabtitle);
+
FreeVec(g);
return;
}
DisposeObject(g->shared->objects[OID_MAIN]);
+ free(g->shared->wintitle);
ami_utf8_free(g->shared->status);
FreeVec(g->shared->svbuffer);
@@ -2972,8 +2975,9 @@ void gui_window_set_title(struct gui_window *g, const char *title)
{
node = g->tab_node;
- SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],g->shared->win,NULL,
- CLICKTAB_Labels,~0,
+ SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
+ g->shared->win, NULL,
+ CLICKTAB_Labels, ~0,
TAG_DONE);
SetClickTabNodeAttrs(node, TNA_Text, utf8title,
@@ -2985,6 +2989,9 @@ 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);
@@ -2997,8 +3004,8 @@ void gui_window_set_title(struct gui_window *g, const char *title)
{
if((g->shared->wintitle == NULL) || (strcmp(utf8title, g->shared->wintitle)))
{
- if(g->shared->wintitle) ami_utf8_free(g->shared->wintitle);
- g->shared->wintitle = utf8title;
+ if(g->shared->wintitle) free(g->shared->wintitle);
+ g->shared->wintitle = strdup(utf8title);
SetWindowTitles(g->shared->win, g->shared->wintitle, nsscreentitle);
}
}