[gtk-cffi-cvs] CVS gtk-cffi/cffi
CVS User rklochkov
rklochkov at common-lisp.net
Sat Dec 31 17:20:56 UTC 2011
Update of /project/gtk-cffi/cvsroot/gtk-cffi/cffi
In directory tiger.common-lisp.net:/tmp/cvs-serv25018/cffi
Modified Files:
cffi-object.asd object.lisp
Log Message:
Moved addons to gtk-cffi-ext
--- /project/gtk-cffi/cvsroot/gtk-cffi/cffi/cffi-object.asd 2011/08/26 17:16:13 1.2
+++ /project/gtk-cffi/cvsroot/gtk-cffi/cffi/cffi-object.asd 2011/12/31 17:20:56 1.3
@@ -14,7 +14,7 @@
:author "Roman Klochkov <kalimehtar at mail.ru>"
:version "0.9"
:license "BSD"
- :depends-on (cffi iterate gtk-cffi-utils)
+ :depends-on (cffi iterate gtk-cffi-utils trivial-garbage)
:components
((:file package)
(:file object :depends-on (package))
--- /project/gtk-cffi/cvsroot/gtk-cffi/cffi/object.lisp 2011/09/10 16:26:09 1.5
+++ /project/gtk-cffi/cvsroot/gtk-cffi/cffi/object.lisp 2011/12/31 17:20:56 1.6
@@ -21,10 +21,13 @@
:initarg :volatile :initform t)
(id :type symbol :accessor id :initarg :id :initform nil))
(:documentation "Lisp wrapper for any object. VOLATILE slot set when object
-shouldn't be stored in *OBJECTS*"))
+shouldn't be stored in *OBJECTS*. Stored pointer GC'ed, if VOLATILE."))
(defmethod (setf pointer) :after (value (object object))
(declare (type foreign-pointer value))
+ (tg:cancel-finalization object)
+ (when (and (volatile object) (not (null-pointer-p value)))
+ (tg:finalize object (lambda () (foreign-free value))))
(unless (or (volatile object) (null-pointer-p value))
(setf (gethash (pointer-address value) *objects*) object)
(when (id object)
More information about the gtk-cffi-cvs
mailing list