[PD-cvs] SF.net SVN: pure-data: [9980] branches/pd-extended/v0-40/pd/src/m_class.c

zmoelnig at users.sourceforge.net zmoelnig at users.sourceforge.net
Wed Jun 11 14:02:11 CEST 2008


Revision: 9980
          http://pure-data.svn.sourceforge.net/pure-data/?rev=9980&view=rev
Author:   zmoelnig
Date:     2008-06-11 05:02:11 -0700 (Wed, 11 Jun 2008)

Log Message:
-----------
a bit less restrictive recursion check (patch #1990599) - this should allow hexloader to work

Modified Paths:
--------------
    branches/pd-extended/v0-40/pd/src/m_class.c

Modified: branches/pd-extended/v0-40/pd/src/m_class.c
===================================================================
--- branches/pd-extended/v0-40/pd/src/m_class.c	2008-06-10 08:59:57 UTC (rev 9979)
+++ branches/pd-extended/v0-40/pd/src/m_class.c	2008-06-11 12:02:11 UTC (rev 9980)
@@ -528,6 +528,7 @@
     return (gensym(namebuf));
 }
 
+#define MAXOBJDEPTH 1000
 static int tryingalready;
 
 void canvas_popabstraction(t_canvas *x);
@@ -545,14 +546,17 @@
     t_pd *current;
     int fd;
     char dirbuf[FILENAME_MAX], *nameptr;
-    if (tryingalready) return;
+    if (tryingalready>MAXOBJDEPTH){
+      error("maximum object loading depth %d reached", MAXOBJDEPTH);
+      return;
+    }
     newest = 0;
     class_loadsym = s;
     if (sys_load_lib(canvas_getcurrent(), s->s_name))
     {
-        tryingalready = 1;
+        tryingalready++;
         typedmess(dummy, s, argc, argv);
-        tryingalready = 0;
+        tryingalready--;
         return;
     }
     class_loadsym = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list