feat(actions): added content field to Action to copy the insert text
This commit is contained in:
parent
1dd9e2cbca
commit
315e37b643
2 changed files with 15 additions and 0 deletions
|
|
@ -38,3 +38,16 @@ void append_list(ActionList* list1, ActionList* list2) {
|
|||
memcpy(list1->actions + list1->len, list2->actions, list2->len * sizeof *list2->actions);
|
||||
list1->len += list2->len;
|
||||
}
|
||||
|
||||
void free_action_list(ActionList* list) {
|
||||
if (!list) return;
|
||||
|
||||
for (size_t i = 0; i < list->len; i++) {
|
||||
if (list->actions[i].content) {
|
||||
free(list->actions[i].content); // Free content for INSERT actions
|
||||
}
|
||||
}
|
||||
|
||||
free(list->actions); // Free the array of actions
|
||||
free(list); // Free the ActionList itself
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue