Commit 03ef5d01 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*made undo+preset hub sync more robust

*fixed preset segfault when doing clear on a hubless node
*clean-up
parent 302a88b4
......@@ -2384,7 +2384,6 @@ void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize, int pos)
//probably don't need this here, but doesn't hurt to leave it in
glob_preset_node_list_seek_hub();
glob_preset_node_list_check_loc_and_update();
}
}
......
......@@ -89,6 +89,7 @@ void canvas_undo_undo(t_canvas *x)
their regular call will fail in case their position needed
to be updated by undo/redo first to reflect the old one */
glob_preset_node_list_seek_hub();
glob_preset_node_list_check_loc_and_update();
if (glist_isvisible(x) && glist_istoplevel(x))
{
sys_vgui("pdtk_undomenu .x%lx %s %s\n",
......@@ -133,6 +134,7 @@ void canvas_undo_redo(t_canvas *x)
regular call will fail in case their position needed to be updated
by undo/redo first to reflect the old one */
glob_preset_node_list_seek_hub();
glob_preset_node_list_check_loc_and_update();
if (glist_isvisible(x) && glist_istoplevel(x))
{
sys_vgui("pdtk_undomenu .x%lx %s %s\n",
......
......@@ -656,7 +656,7 @@ void preset_node_clear(t_preset_node *x, t_float f)
{
np1 = hd2->phd_npreset;
// if it is first one
if (np1->np_preset == (int)f)
if (np1 && np1->np_preset == (int)f)
{
hd2->phd_npreset = np1->np_next;
if (np1->np_val.l_n)
......@@ -687,13 +687,12 @@ void preset_node_clear(t_preset_node *x, t_float f)
}
}
}
SETFLOAT(ap+0, f);
SETFLOAT(ap+1, (t_float)changed);
outlet_anything(x->pn_hub->ph_outlet, gensym("node_clear"), 2, ap);
}
if (changed && !x->pn_hub->ph_extern_file)
if (changed && (!x->pn_hub || !x->pn_hub->ph_extern_file))
canvas_dirty(x->pn_hub->ph_canvas, 1);
SETFLOAT(ap+0, f);
SETFLOAT(ap+1, (t_float)changed);
outlet_anything(x->pn_hub->ph_outlet, gensym("node_clear"), 2, ap);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment