mirror of
https://github.com/labwc/labwc.git
synced 2026-03-18 05:33:53 -04:00
Centralize freeing of action lists
Reduces some code duplication and makes it easier to extend struct action
This commit is contained in:
parent
8e9643a855
commit
f0a3f365e5
4 changed files with 14 additions and 17 deletions
10
src/action.c
10
src/action.c
|
|
@ -2,6 +2,7 @@
|
|||
#include <strings.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/spawn.h"
|
||||
#include "common/zfree.h"
|
||||
#include "labwc.h"
|
||||
#include "menu/menu.h"
|
||||
#include "action.h"
|
||||
|
|
@ -76,6 +77,15 @@ action_create(const char *action_name)
|
|||
return action;
|
||||
}
|
||||
|
||||
void action_list_free(struct wl_list *action_list) {
|
||||
struct action *action, *action_tmp;
|
||||
wl_list_for_each_safe(action, action_tmp, action_list, link) {
|
||||
wl_list_remove(&action->link);
|
||||
zfree(action->arg);
|
||||
zfree(action);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
show_menu(struct server *server, const char *menu)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue