/[cffi-objects]/object.lisp
ViewVC logotype

Diff of /object.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by rklochkov, Fri Aug 24 20:44:53 2012 UTC revision 11 by rklochkov, Fri Aug 24 20:47:10 2012 UTC
# Line 70  for example, by g_object_new.")) Line 70  for example, by g_object_new."))
70    (:documentation "Removes object pointer from lisp hashes."))    (:documentation "Removes object pointer from lisp hashes."))
71    
72  (defmethod free ((object object))  (defmethod free ((object object))
73    (unless (null-pointer-p (pointer object))    (with-slots (id pointer free-after) object
74      (remhash (pointer-address (pointer object)) *objects*)      (unless (null-pointer-p pointer)
75      (remhash (id object) *objects-ids*)        (remhash (pointer-address pointer) *objects*)
76      (when (and (slot-value object 'free-after) (not (null-pointer-p value)))        (remhash id *objects-ids*)
77        (free-ptr (class-of object) value))        (when free-after
78      (setf (pointer object) (null-pointer)          (free-ptr (class-of object) pointer))
79            (id object) nil)))        (setf pointer (null-pointer)
80                id  nil))))
81    
82  (defun find-object (pointer &optional class)  (defun find-object (pointer &optional class)
83    "Returns lisp object for an Object pointer.    "Returns lisp object for an Object pointer.

Legend:
Removed from v.10  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.5