Let weak-table-ref kill the entry if the value is #f.
This commit is contained in:
parent
36c5c82ec3
commit
238ba3e8ba
|
@ -9,7 +9,13 @@
|
||||||
|
|
||||||
(define (weak-table-ref table number)
|
(define (weak-table-ref table number)
|
||||||
(let ((ref (table-ref table number)))
|
(let ((ref (table-ref table number)))
|
||||||
(if (weak-pointer? ref) (weak-pointer-ref ref) ref)))
|
(if (weak-pointer? ref)
|
||||||
|
(let ((val (weak-pointer-ref ref)))
|
||||||
|
(if val
|
||||||
|
val
|
||||||
|
(begin (table-set! table number #f)
|
||||||
|
#f)))
|
||||||
|
ref)))
|
||||||
|
|
||||||
(define (weak-table-walk proc table)
|
(define (weak-table-walk proc table)
|
||||||
(table-walk
|
(table-walk
|
||||||
|
|
Loading…
Reference in New Issue