X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/3840beb25c5aefcb3b8b1d101b50d6f8dd90b6f0..1dbf4216c7c6a8845e1831970dd1c0dc3902c4d3:/glib/gobject.lisp?ds=sidebyside diff --git a/glib/gobject.lisp b/glib/gobject.lisp index 4005672..f41cb32 100644 --- a/glib/gobject.lisp +++ b/glib/gobject.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gobject.lisp,v 1.19 2004-11-07 15:58:08 espen Exp $ +;; $Id: gobject.lisp,v 1.20 2004-11-09 10:10:59 espen Exp $ (in-package "GLIB") @@ -205,6 +205,13 @@ (call-next-method) (%object-weak-ref object)) +(defmethod instance-finalizer ((instance gobject)) + (let ((location (proxy-location instance))) + #'(lambda () + (remove-cached-instance location) + (%weak-object-unref location) + (%object-unref location)))) + (defcallback weak-notify (nil (data int) (location pointer)) (let ((object (find-cached-instance location))) @@ -218,6 +225,12 @@ ((callback weak-notify) pointer) (0 unsigned-int)) +(defbinding %object-weak-unref () nil + (location pointer) + ((callback weak-notify) pointer) + (0 unsigned-int)) + + (defbinding (%gobject-new "g_object_new") () pointer (type type-number) (nil null))