summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-08-04 16:52:34 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-08-04 16:52:34 +0200
commit0b07278c11c0ecb073356b15f1ed5e8781583d0c (patch)
treeb557131e29c41cf894dfa6901f33c560d029ed0f /Lisp
parent5cbcd439f32529596ef929a7def75bc054dfc3e4 (diff)
Do not put temporary objects into one of the global wrapper object pools.
darcs-hash:53034b362cc5edf68fc0e9946aa8b8a9d8117728
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/memory-management.lisp7
1 files changed, 6 insertions, 1 deletions
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)))