From: Dmitry Kalyanov Date: Sat, 14 Feb 2009 20:47:07 +0000 (+0300) Subject: Added restart to closure marshal function X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=75fc4480424d0b11025df2b52ddb4cc3f45f5def;p=cl-gtk2.git Added restart to closure marshal function --- diff --git a/glib/gobject.foreign-closures.lisp b/glib/gobject.foreign-closures.lisp index bed6d45..da0e731 100644 --- a/glib/gobject.foreign-closures.lisp +++ b/glib/gobject.foreign-closures.lisp @@ -9,6 +9,11 @@ (declare (ignore data)) (finalize-lisp-closure closure)) +(defun call-with-restarts (fn args) + (restart-case + (apply fn args) + (return-from-g-closure (&optional v) :report "Return value from closure" v))) + (defcallback lisp-closure-marshal :void ((closure (:pointer lisp-closure)) (return-value (:pointer g-value)) (count-of-args :uint) @@ -21,7 +26,7 @@ (return-type (and (not (null-pointer-p return-value)) (gvalue-type return-value))) (fn (get-stable-pointer-value function-id)) - (fn-result (apply fn args))) + (fn-result (call-with-restarts fn args))) (when return-type (set-g-value return-value fn-result return-type))))