Hi,

Kevin Ryde <[EMAIL PROTECTED]> writes:

> I may have struck that or something similar a while back.  Mikael
> explained it was a reference held in the print data of the output
> port, or something.  Used to detect cyclic structures, or something.

Thanks: you put me on the right track!  So this issue is now gone.  :-)

Ludovic.


2005-11-10  Ludovic Courtès  <[EMAIL PROTECTED]>

        * print.c (EXIT_NESTED_DATA): Before popping from the stack,
        reset the value at its top.  This fixes a reference leak.


--- orig/libguile/print.c
+++ mod/libguile/print.c
@@ -136,7 +136,13 @@
   PUSH_REF(pstate, obj); \
 } while(0)
 
-#define EXIT_NESTED_DATA(pstate) { --pstate->top; }
+#define EXIT_NESTED_DATA(pstate)                               \
+do                                                             \
+{                                                              \
+  PSTATE_STACK_SET (pstate, pstate->top, SCM_UNDEFINED);       \
+  --pstate->top;                                               \
+}                                                              \
+while (0)
 
 SCM scm_print_state_vtable = SCM_BOOL_F;
 static SCM print_state_pool = SCM_EOL;
@@ -144,8 +150,8 @@
 
 #ifdef GUILE_DEBUG /* Used for debugging purposes */
 
-SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0, 
-           (),
+SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0,
+           (void),
            "Return the current-pstate -- the car of the\n"
            "@code{print_state_pool}.  @code{current-pstate} is only\n"
            "included in @code{--enable-guile-debug} builds.")


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to