aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_scalar.c
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2003-05-09 16:04:00 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2003-05-09 16:04:00 +0000
commit9c0e19a3be2288db79e2502e5fa450c3e20a668d (patch)
treeca97ce615e037a533304fc4660dcf372ca3b9cd6 /pd/src/g_scalar.c
parentef50dd62804d54af7da18d8bd8413c0dccd729b8 (diff)
This commit was generated by cvs2svn to compensate for changes in r610,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=611
Diffstat (limited to 'pd/src/g_scalar.c')
-rw-r--r--pd/src/g_scalar.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c
index 362fb108..d24564e4 100644
--- a/pd/src/g_scalar.c
+++ b/pd/src/g_scalar.c
@@ -85,6 +85,19 @@ void word_restore(t_word *wp, t_template *template,
post("warning: word_restore: extra arguments");
}
+void word_free(t_word *wp, t_template *template)
+{
+ int i;
+ t_dataslot *dt;
+ for (dt = template->t_vec, i = 0; i < template->t_n; i++, dt++)
+ {
+ if (dt->ds_type == DT_ARRAY)
+ array_free(wp[i].w_array);
+ else if (dt->ds_type == DT_LIST)
+ canvas_free(wp[i].w_list);
+ }
+}
+
/* make a new scalar and add to the glist. We create a "gp" here which
will be used for array items to point back here. This gp doesn't do
reference counting or "validation" updates though; the parent won't go away
@@ -350,13 +363,7 @@ static void scalar_free(t_scalar *x)
error("scalar: couldn't find template %s", templatesym->s_name);
return;
}
- for (dt = template->t_vec, i = 0; i < template->t_n; i++, dt++)
- {
- if (dt->ds_type == DT_ARRAY)
- array_free(x->sc_vec[i].w_array);
- else if (dt->ds_type == DT_LIST)
- canvas_free(x->sc_vec[i].w_list);
- }
+ word_free(x->sc_vec, template);
gfxstub_deleteforkey(x);
/* the "size" field in the class is zero, so Pd doesn't try to free
us automatically (see pd_free()) */