Skip to content

Commit

Permalink
Bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
agraef committed Oct 5, 2018
1 parent 7ca9c7f commit 6d77ec9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pd-pure/pure.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ typedef struct _pure {
void *tmp, *tmpst; /* temporary storage */
bool save; /* enables the pd_save/pd_restore feature */
bool is_dsp; /* indicates a tilde object */
bool reloading; /* object is currently being reloaded */
pure_expr *sigx; /* Pure expression holding the input signal */
char *open_filename; /* menu-open filename (script by default) */
/* asynchronous messaging */
Expand Down Expand Up @@ -1116,7 +1117,7 @@ static bool receive_message(t_pure *x, t_symbol *s, int k,
bool reload = false;

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

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

x->cls = c;
x->is_dsp = is_dsp;
x->reloading = false;
x->interp = c->interp;
x->canvas = canvas;
x->foo = 0;
Expand Down Expand Up @@ -1813,6 +1815,8 @@ static void pure_refini(t_pure *x, bool rebind)
x->recvin = 0;
x->recvsym = 0;
}
// Make sure that we don't receive anything during reload.
x->reloading = true;
if (x->foo) {
if (x->save) {
/* Record object state, if available. */
Expand Down Expand Up @@ -2073,6 +2077,7 @@ static void pure_reinit(t_pure *x)
x->sigx = pure_new(pure_double_matrix(x->sig));
}
pure_pop_interp(x_interp);
x->reloading = false;
}

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

0 comments on commit 6d77ec9

Please sign in to comment.