gdbm: Add event:after-restart receiver reset-open-gdbfs.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Sun, 8 Sep 2013 19:32:30 +0000 (12:32 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Sun, 8 Sep 2013 19:32:30 +0000 (12:32 -0700)
src/gdbm/gdbm.scm

index a799b119f8db679ceef80e03f914d3d4aab49686..6eee587550d4fac25aecdc31acbd5cf9ba35f7ec 100644 (file)
@@ -363,7 +363,12 @@ USA.
                          (alien-null! args)))
                    (loop next prev))))))))
 
+(define (reset-open-gdbfs)
+  (for-each (lambda (weak) (alien-null! (weak-cdr weak))) open-gdbfs)
+  (set! open-gdbfs '()))
+
 (define (initialize-package!)
   (set! open-gdbfs-mutex (make-thread-mutex))
   (set! open-gdbfs '())
-  (add-gc-daemon! cleanup-open-gdbfs))
\ No newline at end of file
+  (add-gc-daemon! cleanup-open-gdbfs)
+  (add-event-receiver! event:after-restart reset-open-gdbfs))
\ No newline at end of file