module/i3: use module common constructor/destructor

This commit is contained in:
Daniel Eklöf 2018-12-19 18:57:19 +01:00
parent 16553a7216
commit 536db672b4

View file

@ -393,7 +393,7 @@ destroy(struct module *mod)
mtx_destroy(&m->lock); mtx_destroy(&m->lock);
free(m); free(m);
free(mod); module_default_destroy(mod);
} }
static struct exposable * static struct exposable *
@ -472,14 +472,10 @@ module_i3(struct i3_workspaces workspaces[], size_t workspace_count,
m->workspaces.v = NULL; m->workspaces.v = NULL;
m->workspaces.count = 0; m->workspaces.count = 0;
struct module *mod = malloc(sizeof(*mod)); struct module *mod = module_common_new();
mod->bar = NULL;
mod->private = m; mod->private = m;
mod->run = &run; mod->run = &run;
mod->destroy = &destroy; mod->destroy = &destroy;
mod->content = &content; mod->content = &content;
mod->begin_expose = &module_default_begin_expose;
mod->expose = &module_default_expose;
mod->end_expose = &module_default_end_expose;
return mod; return mod;
} }