Opened 11 years ago

#659 new defect

kap flaw on repeated use

Reported by: bhyde Owned by:
Priority: normal Milestone:
Component: Objective-C Bridge Version: trunk
Keywords: Cc:


If you invoke :kap it, appropriately, releases the auto release pool and sets ccl::*listner-auto-release-pool* to nil. Invoke it again and it releases NIL. Complaints follow: "value NIL is not of the expected type CCL:MACPTR." patch:

Index: objc-support.lisp
--- objc-support.lisp	(revision 13410)
+++ objc-support.lisp	(working copy)
@@ -480,7 +480,8 @@
      (when (boundp '*listener-autorelease-pool*)
        (let* ((p *listener-autorelease-pool*))
 	 (setq *listener-autorelease-pool* nil)
-	 (release-autorelease-pool p))))))
+         (when p
+           (release-autorelease-pool p)))))))
 ;;; Use the interfaces for an add-on ObjC framework.  We need to
 ;;; tell the bridge to reconsider what it knows about the type

or, if your into it...

(define-toplevel-command :global kap () "Release (but don't reestablish) *LISTENER-AUTORELEASE-POOL*"
  (when (eql *break-level* 0)
     (when (and (boundp '*listener-autorelease-pool*)
       (release-auto-release-pool (shiftf *listener-autorelease-pool* nil))))))

Change History (0)

Note: See TracTickets for help on using tickets.