Skip to content

Commit 6d77ec9

Browse files
committed
Bugfix.
1 parent 7ca9c7f commit 6d77ec9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pd-pure/pure.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ typedef struct _pure {
505505
void *tmp, *tmpst; /* temporary storage */
506506
bool save; /* enables the pd_save/pd_restore feature */
507507
bool is_dsp; /* indicates a tilde object */
508+
bool reloading; /* object is currently being reloaded */
508509
pure_expr *sigx; /* Pure expression holding the input signal */
509510
char *open_filename; /* menu-open filename (script by default) */
510511
/* asynchronous messaging */
@@ -1116,7 +1117,7 @@ static bool receive_message(t_pure *x, t_symbol *s, int k,
11161117
bool reload = false;
11171118

11181119
/* check whether we have something to evaluate */
1119-
if (!f) return false;
1120+
if (!f || x->reloading) return false;
11201121

11211122
/* Build the parameter expression from the message. Floats, lists and
11221123
symbols get special treatment, other kinds of objects are passed using
@@ -1616,6 +1617,7 @@ static void *pure_init(t_symbol *s, int argc, t_atom *argv)
16161617

16171618
x->cls = c;
16181619
x->is_dsp = is_dsp;
1620+
x->reloading = false;
16191621
x->interp = c->interp;
16201622
x->canvas = canvas;
16211623
x->foo = 0;
@@ -1813,6 +1815,8 @@ static void pure_refini(t_pure *x, bool rebind)
18131815
x->recvin = 0;
18141816
x->recvsym = 0;
18151817
}
1818+
// Make sure that we don't receive anything during reload.
1819+
x->reloading = true;
18161820
if (x->foo) {
18171821
if (x->save) {
18181822
/* Record object state, if available. */
@@ -2073,6 +2077,7 @@ static void pure_reinit(t_pure *x)
20732077
x->sigx = pure_new(pure_double_matrix(x->sig));
20742078
}
20752079
pure_pop_interp(x_interp);
2080+
x->reloading = false;
20762081
}
20772082

20782083
/* Setup for a Pure object class with the given name. */

0 commit comments

Comments
 (0)