From 16ed7f954fb57fbf363942d3600537210d726ef2 Mon Sep 17 00:00:00 2001
From: Guillem <guillembartrina@gmail.com>
Date: Wed, 23 Sep 2020 16:45:03 +0200
Subject: [PATCH] some small fixes. replace 0xF1A6 trick with the safer
 dummy_canvas_env one

---
 pd/src/g_canvas.c | 5 +++--
 pd/src/g_graph.c  | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c
index f504277c3..61714dd33 100644
--- a/pd/src/g_canvas.c
+++ b/pd/src/g_canvas.c
@@ -2464,7 +2464,7 @@ static void canvas_abpush(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
     t_canvas *c = canvas_getcurrent();
     t_symbol *name = argv[0].a_w.w_symbol;
     t_binbuf *source = binbuf_new();
-    x->gl_env = 0xF1A6; //to save it as a root canvas
+    x->gl_env = dummy_canvas_env(canvas_getdir(x)->s_name); //to save it as a root canvas
     mess1(&((t_text *)x)->te_pd, gensym("saveto"), source);
     x->gl_env = 0;
 
@@ -2559,7 +2559,8 @@ static void *ab_new(t_symbol *s, int argc, t_atom *argv)
         }
         else
         {
-            error("ab_new: can't insantiate ab within itself\n cycle: %s", res);
+            if(!glist_amreloadingabstractions)
+                error("ab_new: can't insantiate ab within itself\n cycle: %s", res);
             newest = 0;
         }
     }
diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c
index d93cd3db6..dafe3e709 100644
--- a/pd/src/g_graph.c
+++ b/pd/src/g_graph.c
@@ -202,6 +202,8 @@ int canvas_hasarray(t_canvas *x)
 /* JMZ: emit a closebang message */
 void canvas_closebang(t_canvas *x);
 
+void canvas_dirtyclimb(t_canvas *x, int n);
+
     /* delete an object from a glist and free it */
 void glist_delete(t_glist *x, t_gobj *y)
 {
-- 
GitLab