mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-19 01:05:39 +02:00
exposable: add a "common" constructor and default destructor
This commit is contained in:
parent
acda1a4b21
commit
e8d8bf70d3
6 changed files with 59 additions and 33 deletions
|
@ -48,7 +48,7 @@ exposable_destroy(struct exposable *exposable)
|
|||
e->exposables[i]->destroy(e->exposables[i]);
|
||||
free(e->exposables);
|
||||
free(e);
|
||||
free(exposable);
|
||||
exposable_default_destroy(exposable);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -120,8 +120,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
|
|||
|
||||
assert(idx == epriv->count);
|
||||
|
||||
struct exposable *exposable = malloc(sizeof(*exposable));
|
||||
exposable->particle = particle;
|
||||
struct exposable *exposable = exposable_common_new(particle, NULL);
|
||||
exposable->private = epriv;
|
||||
exposable->destroy = &exposable_destroy;
|
||||
exposable->begin_expose = &begin_expose;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue