Use strcmp, fix constructor & destrucor calling for classes witn namespace (phonon::MediaPlayer) and add :arg0 to :arg2 initargs
src/object-map.lisp
Thu Jul 23 00:26:05 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use strcmp, fix constructor & destrucor calling for classes witn namespace (phonon::MediaPlayer) and add :arg0 to :arg2 initargs
--- old-smoke/src/object-map.lisp 2014-10-30 08:12:34.000000000 +0100
+++ new-smoke/src/object-map.lisp 2014-10-30 08:12:34.000000000 +0100
@@ -64,10 +64,8 @@
(defun remove-object (pointer)
(declare (optimize (speed 3)))
- (assert (has-pointer-p pointer)
- (pointer)
- "No object to remove for pointer ~A." pointer)
- (remhash (pointer-address pointer) *object-map*))
+ (unless (remhash (pointer-address pointer) *object-map*)
+ (cerror "ignore" "No object to remove for pointer ~A." pointer)))
(defun report-finalize-error (condition function class pointer)
"Report the error CONDITION it the finalizer FUNCTION for the
@@ -102,6 +100,17 @@
(handler-case (delete-pointer pointer class)
(error (condition)
(report-finalize-error condition 't (name class) pointer))))))
+
+(defun debug-finalize ()
+ (eval '(defmethod make-finalize :around (object)
+ (let ((pointer (pointer object))
+ (class (class-of object))
+ (next (call-next-method)))
+ #'(lambda ()
+ (format *debug-io* "cl-smoke: finalizing: ~A..."
+ (make-instance class :pointer pointer))
+ (funcall next)
+ (format *debug-io* "done~%"))))))
(defun add-object (object)
"Adds OBJECT to the pointer -> object map. It can later be retrieved