rework Button bindings freeness
This commit is contained in:
parent
dae3bcd2c7
commit
bf37316aad
46
awesome.c
46
awesome.c
|
@ -50,11 +50,24 @@
|
||||||
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
static int (*xerrorxlib) (Display *, XErrorEvent *);
|
||||||
static Bool running = True;
|
static Bool running = True;
|
||||||
|
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
cleanup_buttons(Button *buttons)
|
||||||
|
{
|
||||||
|
Button *b, *bn;
|
||||||
|
|
||||||
|
for(b = buttons; b; b = bn)
|
||||||
|
{
|
||||||
|
bn = b->next;
|
||||||
|
p_delete(&b->arg);
|
||||||
|
p_delete(&b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cleanup_screen(awesome_config *awesomeconf)
|
cleanup_screen(awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Button *b, *bn;
|
|
||||||
Key *k, *kn;
|
Key *k, *kn;
|
||||||
Rule *r, *rn;
|
Rule *r, *rn;
|
||||||
|
|
||||||
|
@ -72,29 +85,13 @@ cleanup_screen(awesome_config *awesomeconf)
|
||||||
kn = k->next;
|
kn = k->next;
|
||||||
p_delete(&k);
|
p_delete(&k);
|
||||||
}
|
}
|
||||||
for(b = awesomeconf->buttons.tag; b; b = bn)
|
|
||||||
{
|
cleanup_buttons(awesomeconf->buttons.tag);
|
||||||
bn = b->next;
|
cleanup_buttons(awesomeconf->buttons.title);
|
||||||
p_delete(&b);
|
cleanup_buttons(awesomeconf->buttons.layout);
|
||||||
}
|
cleanup_buttons(awesomeconf->buttons.root);
|
||||||
for(b = awesomeconf->buttons.title; b; b = bn)
|
cleanup_buttons(awesomeconf->buttons.client);
|
||||||
{
|
|
||||||
bn = b->next;
|
|
||||||
p_delete(&b->arg);
|
|
||||||
p_delete(&b);
|
|
||||||
}
|
|
||||||
for(b = awesomeconf->buttons.layout; b; b = bn)
|
|
||||||
{
|
|
||||||
bn = b->next;
|
|
||||||
p_delete(&b->arg);
|
|
||||||
p_delete(&b);
|
|
||||||
}
|
|
||||||
for(b = awesomeconf->buttons.root; b; b = bn)
|
|
||||||
{
|
|
||||||
bn = b->next;
|
|
||||||
p_delete(&b->arg);
|
|
||||||
p_delete(&b);
|
|
||||||
}
|
|
||||||
for(i = 0; i < awesomeconf->nlayouts; i++)
|
for(i = 0; i < awesomeconf->nlayouts; i++)
|
||||||
p_delete(&awesomeconf->layouts[i].symbol);
|
p_delete(&awesomeconf->layouts[i].symbol);
|
||||||
for(r = awesomeconf->rules; r; r = rn)
|
for(r = awesomeconf->rules; r; r = rn)
|
||||||
|
@ -104,6 +101,7 @@ cleanup_screen(awesome_config *awesomeconf)
|
||||||
p_delete(&r->tags);
|
p_delete(&r->tags);
|
||||||
p_delete(&r);
|
p_delete(&r);
|
||||||
}
|
}
|
||||||
|
|
||||||
p_delete(&awesomeconf->tags);
|
p_delete(&awesomeconf->tags);
|
||||||
p_delete(&awesomeconf->layouts);
|
p_delete(&awesomeconf->layouts);
|
||||||
p_delete(&awesomeconf->configpath);
|
p_delete(&awesomeconf->configpath);
|
||||||
|
|
Loading…
Reference in New Issue