clear objc ivar on `dealloc'

so that a field is not incorrectly used if the super `dealloc' triggers
 callbacks
This commit is contained in:
Matthew Flatt 2010-11-24 07:08:54 -07:00
parent f245b6ca29
commit 0d6d285423

View File

@ -372,7 +372,9 @@
(define (free-fields obj names)
(for-each (lambda (name)
(let-values ([(ivar p) (object_getInstanceVariable obj name)])
(when p (free-immobile-cell p))))
(when p
(object_setInstanceVariable obj name #f)
(free-immobile-cell p))))
names))
;; ----------------------------------------