mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 04:15:39 +02:00
clock: use module common constructor and destructor
This commit is contained in:
parent
edc418b22d
commit
72624af1fa
1 changed files with 2 additions and 6 deletions
|
@ -17,7 +17,7 @@ destroy(struct module *mod)
|
|||
struct private *m = mod->private;
|
||||
m->label->destroy(m->label);
|
||||
free(m);
|
||||
free(mod);
|
||||
module_default_destroy(mod);
|
||||
}
|
||||
|
||||
static struct exposable *
|
||||
|
@ -77,14 +77,10 @@ module_clock(struct particle *label)
|
|||
struct private *m = malloc(sizeof(*m));
|
||||
m->label = label;
|
||||
|
||||
struct module *mod = malloc(sizeof(*mod));
|
||||
mod->bar = NULL;
|
||||
struct module *mod = module_common_new();
|
||||
mod->private = m;
|
||||
mod->run = &run;
|
||||
mod->destroy = &destroy;
|
||||
mod->content = &content;
|
||||
mod->begin_expose = &module_default_begin_expose;
|
||||
mod->expose = &module_default_expose;
|
||||
mod->end_expose = &module_default_end_expose;
|
||||
return mod;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue