Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
f116b8d1
Commit
f116b8d1
authored
Jan 29, 2017
by
Jonathan Wilkes
Browse files
fix a crasher with uninitialized canvas field abstraction names
parent
39823ac8
Changes
3
Show whitespace changes
Inline
Side-by-side
pd/src/g_canvas.h
View file @
f116b8d1
...
...
@@ -258,7 +258,7 @@ typedef struct _dataslot
{
int
ds_type
;
t_symbol
*
ds_name
;
t_symbol
*
ds_fieldtemplate
;
/* filled in for array
s only
*/
t_symbol
*
ds_fieldtemplate
;
/* filled in
only
for array
/canvas fields
*/
t_binbuf
*
ds_binbuf
;
/* binbuf of an abstraction to be loaded */
}
t_dataslot
;
...
...
pd/src/g_readwrite.c
View file @
f116b8d1
...
...
@@ -787,8 +787,10 @@ static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething)
case
DT_TEXT
:
type
=
gensym
(
"text"
);
break
;
//&s_list; break;
default:
type
=
&
s_float
;
bug
(
"canvas_write"
);
}
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
||
template
->
t_vec
[
j
].
ds_type
==
DT_LIST
)
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_LIST
)
binbuf_addv
(
b
,
"sss"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
));
else
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
)
binbuf_addv
(
b
,
"sss"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
+
3
));
else
binbuf_addv
(
b
,
"ss"
,
type
,
template
->
t_vec
[
j
].
ds_name
);
...
...
pd/src/g_template.c
View file @
f116b8d1
...
...
@@ -96,8 +96,9 @@ t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv)
pd_error(x, "canvas lacks template or name");
goto bad;
}
/* If we keep the canvas field API this needs to be revisited */
//filename = canvas_makebindsym(argv[2].a_w.w_symbol);
/* We're abusing newarraytemplate here to store the name of
the abstraction (minus the .pd extension) */
newarraytemplate = argv[2].a_w.w_symbol;
sprintf(filename, "%s.pd", argv[2].a_w.w_symbol->s_name);
if (binbuf_read_via_canvas(b, filename, canvas_getcurrent(), 0))
post("warning: abstraction %s not found", filename);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment