[cffi-devel] Program hanging on foreign-funcall
Jakob Reschke
jakres at googlemail.com
Thu Mar 4 22:34:44 UTC 2010
I found the problem. I was just grovelling this ag-cffi::editable slot
with the wrong type (the struct type instead of :pointer).
> Whereas the following CFFI Lisp, which is supposed to be equivalent,
> at the REPL does not:
>
> (with-core-and-video
> (cffi:with-foreign-object (buffer :char 100)
> (let* ((win (cffi::foreign-funcall "AG_WindowNew" :int 0 :pointer))
> (tb (cffi::foreign-funcall "AG_TextboxNew" :pointer win :int
> 0 :string "box:" :pointer))
> (ed (cffi::foreign-slot-value tb 'ag-cffi::textbox
> 'ag-cffi::editable)))
> (ag:window-show win)
> ;; hangs here:
> (cffi::foreign-funcall "AG_EditableBindUTF8" :pointer ed :pointer
> buffer :int 100 :void)
> (cffi::foreign-funcall "AG_EditableSetString" :pointer ed :string
> "foobar" :void)
> (cffi::foreign-funcall "AG_EventLoop_FixedFPS" :void))))
More information about the cffi-devel
mailing list