X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/61308fc461733d234c0f09a0bf9f4edcd5e2f314..ad4a2c4e90303713b089383980ddaca3c715ca9b:/gffi/proxy.lisp diff --git a/gffi/proxy.lisp b/gffi/proxy.lisp index d67ee96..7ce9f05 100644 --- a/gffi/proxy.lisp +++ b/gffi/proxy.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: proxy.lisp,v 1.7 2007-04-06 14:29:42 espen Exp $ +;; $Id: proxy.lisp,v 1.10 2007-12-11 14:26:11 espen Exp $ (in-package "GFFI") @@ -167,6 +167,7 @@ ;; :FINALZIE given to MAKE-PROXY-INSTANCE or non NIL if the proxy was ;; created with MAKE-INSTANCE (defmethod invalidate-instance ((instance proxy) &optional finalize-p) + #+clisp(declare (ignore finalize-p)) (remove-cached-instance (foreign-location instance)) #+(or sbcl cmu) (progn @@ -301,6 +302,8 @@ #'(lambda (value object) (unless writer (setq writer (mkbinding setter nil 'pointer type))) + ;; First argument in foreign setters is the object and second + ;; is value (funcall writer (foreign-location object) value))) (call-next-method))) @@ -596,7 +599,7 @@ object at the give location.")) (define-type-method callback-wrapper ((type struct) var arg form) (let ((class (type-expand type))) - `(let ((,var (ensure-proxy-instance ',class ,arg :finalize nil))) + `(let ((,var (ensure-proxy-instance ',class ,arg :reference nil :finalize nil))) (unwind-protect ,form (invalidate-instance ,var)))))