chiark / gitweb /
Correctly sort out string-specified getters in virtual-slots.lisp
[clg] / gffi / proxy.lisp
index 6586891a5bf814fb4930dfec456fb9ede69b2c69..7ce9f050e4e215209cb4af3deee68f6de73ef050 100644 (file)
@@ -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.8 2007-05-10 20:23:28 espen Exp $
+;; $Id: proxy.lisp,v 1.10 2007-12-11 14:26:11 espen Exp $
 
 (in-package "GFFI")
 
@@ -302,6 +302,8 @@   (defmethod compute-slot-writer-function ((slotd effective-virtual-alien-slot-d
          #'(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)))
   
@@ -597,7 +599,7 @@ (defmethod compute-slots :around ((class struct-class))
 
 (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)))))