diff --git a/pitfall/pitfall/reference.rkt b/pitfall/pitfall/reference.rkt index aef97e89..087e88cf 100644 --- a/pitfall/pitfall/reference.rkt +++ b/pitfall/pitfall/reference.rkt @@ -29,8 +29,10 @@ (set! current-id val)) (define (make-ref [payload (make-hasheq)]) + (define new-ref (make-object PDFReference current-id payload)) + (for-each (λ (listener-proc) (listener-proc new-ref)) ref-listeners) (begin0 - (make-object PDFReference current-id payload) + new-ref (set! current-id (add1 current-id)))) (define PDFReference @@ -41,8 +43,6 @@ (field [(@offset offset) #f] [@port (open-output-bytes)]) - (for-each (λ (listener-proc) (listener-proc this)) ref-listeners) - (define/public (write x) (write-bytes (to-bytes x) @port))