summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-27 00:01:42 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-27 00:01:42 +0000
commit2c380f818f3101333639d7a52651ca2f29be08d6 (patch)
tree5fc6ebd85dd8562cba66e44189a2661457703f5b /amiga
parent780752d276578751a58435ba3d3b6600a90a16b0 (diff)
downloadnetsurf-2c380f818f3101333639d7a52651ca2f29be08d6.tar.gz
netsurf-2c380f818f3101333639d7a52651ca2f29be08d6.tar.bz2
Fix some memory leakage
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui_options.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 85d9094a4..e007b9914 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -210,6 +210,7 @@ enum
enum {
NSA_LIST_CLICKTAB = 0,
+ NSA_LIST_CHOOSER,
NSA_LIST_RADIO,
};
@@ -242,10 +243,20 @@ static void ami_gui_opts_array_to_list(struct List *list, const char *array[], i
NewList(list);
do {
- node = AllocClickTabNode(TNA_Text, array[i], TNA_Number, i, TAG_DONE);
+ switch(type) {
+ case NSA_LIST_CLICKTAB:
+ node = AllocClickTabNode(TNA_Text, array[i], TNA_Number, i, TAG_DONE);
+ break;
+ case NSA_LIST_CHOOSER:
+ node = AllocChooserNode(CNA_Text, array[i], TAG_DONE);
+ break;
+ case NSA_LIST_RADIO:
+ default:
+ break;
+ }
AddTail(list, node);
i++;
- } while (tabs[i] != 0);
+ } while (array[i] != 0);
}
static void ami_gui_opts_free_list(struct List *list, int type)
@@ -258,7 +269,20 @@ static void ami_gui_opts_free_list(struct List *list, int type)
do {
nnode = GetSucc(node);
- if(node) FreeClickTabNode(node);
+ Remove(node);
+ if(node) {
+ switch(type) {
+ case NSA_LIST_CLICKTAB:
+ FreeClickTabNode(node);
+ break;
+ case NSA_LIST_CHOOSER:
+ FreeChooserNode(node);
+ break;
+ case NSA_LIST_RADIO:
+ default:
+ break;
+ }
+ }
} while((node = nnode));
}
#endif
@@ -2243,6 +2267,7 @@ void ami_gui_opts_websearch_free(struct List *websearchlist)
do {
nnode = GetSucc(node);
Remove(node);
+ FreeChooserNode(node);
} while((node = nnode));
FreeVec(websearchlist);