[cffi-objects-cvs] r11 -
rklochkov at common-lisp.net
rklochkov at common-lisp.net
Fri Aug 24 20:47:10 UTC 2012
Author: rklochkov
Date: Fri Aug 24 13:47:10 2012
New Revision: 11
Log:
Bugfix
Modified:
object.lisp
Modified: object.lisp
==============================================================================
--- object.lisp Fri Aug 24 13:44:53 2012 (r10)
+++ object.lisp Fri Aug 24 13:47:10 2012 (r11)
@@ -70,13 +70,14 @@
(:documentation "Removes object pointer from lisp hashes."))
(defmethod free ((object object))
- (unless (null-pointer-p (pointer object))
- (remhash (pointer-address (pointer object)) *objects*)
- (remhash (id object) *objects-ids*)
- (when (and (slot-value object 'free-after) (not (null-pointer-p value)))
- (free-ptr (class-of object) value))
- (setf (pointer object) (null-pointer)
- (id object) nil)))
+ (with-slots (id pointer free-after) object
+ (unless (null-pointer-p pointer)
+ (remhash (pointer-address pointer) *objects*)
+ (remhash id *objects-ids*)
+ (when free-after
+ (free-ptr (class-of object) pointer))
+ (setf pointer (null-pointer)
+ id nil))))
(defun find-object (pointer &optional class)
"Returns lisp object for an Object pointer.
More information about the cffi-objects-cvs
mailing list