(*ct->currItem ? (*ct->currItem)->depth : 0) * 3 + 4);
}
-static void ctDestroy(newtComponent co) {
- struct CheckboxTree * ct = co->data;
- struct items * item, * nextitem;
-
- nextitem = item = ct->itemlist;
+static void destroyItems(struct items * item) {
+ struct items * nextitem;
while (item != NULL) {
nextitem = item->next;
free(item->text);
+ if (item->branch)
+ destroyItems(item->branch);
free(item);
item = nextitem;
}
+}
+static void ctDestroy(newtComponent co) {
+ struct CheckboxTree * ct = co->data;
+
+ destroyItems(ct->itemlist);
+ free(ct->flatList);
+ if (ct->sb)
+ ct->sb->ops->destroy(ct->sb);
free(ct->seq);
free(ct);
free(co);
treeTop = item->branch;
}
+ free(path);
buildFlatList(co);
item = findItem(ct->itemlist, data);
%changelog
- fix cursor positioning when setting entry or checkbox flags
- fix counting of items in checkboxtree
+- fix some memory leaks
- fix entry scrolling (#234829)
- fix multibyte character handling in entry
j = (int) *ptr++;
printf("%d\n", j);
}
+ free(result);
+
result = newtCheckboxTreeGetMultiSelection(checktree, &numselected, 'b');
ptr = result;
if (!result || !numselected)
for (i = 0; list && list[i] != NEWT_ARG_LAST; i++)
printf(" %d", list[i]);
printf("\n");
+ free(list);
newtFormDestroy(form);
int i;
struct textbox * tb = co->data;
+ if (tb->sb)
+ tb->sb->ops->destroy(tb->sb);
+ if (tb->sb_act)
+ tb->sb_act->ops->destroy(tb->sb_act);
for (i = 0; i < tb->numLines; i++)
free(tb->lines[i]);
free(tb->lines);