From 0b07278c11c0ecb073356b15f1ed5e8781583d0c Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sat, 4 Aug 2007 16:52:34 +0200 Subject: Do not put temporary objects into one of the global wrapper object pools. darcs-hash:53034b362cc5edf68fc0e9946aa8b8a9d8117728 --- Lisp/memory-management.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lisp/memory-management.lisp b/Lisp/memory-management.lisp index 4476957..1c540fb 100644 --- a/Lisp/memory-management.lisp +++ b/Lisp/memory-management.lisp @@ -62,10 +62,15 @@ (null (setf (weak-gethash hash-key hash-table) :incomplete) (let ((new-obj (call-next-method))) - (setf (weak-gethash hash-key hash-table) new-obj) (unless *skip-retaining* (objcl-invoke-class-method new-obj "retain")) (unless *skip-finalization* + ;; We only put the new object into the hash + ;; table if it is a regular wrapper object + ;; rather than a temporary one, else the object + ;; pointed to might be released prematurely + ;; because of the lack of memory management. + (setf (weak-gethash hash-key hash-table) new-obj) (assert (not (null (pointer-to new-obj)))) (let ((saved-pointer (pointer-to new-obj)) (saved-type (type-of new-obj))) -- cgit v1.2.3