X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/6cb19a68c40d5ab90700eabfcd41ff635e91967f..29933e836dd53611fe53d0e1e51eac1a551c0de3:/glib/gobject.lisp diff --git a/glib/gobject.lisp b/glib/gobject.lisp index 3f1b348..2370ebd 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 @@ (defmethod initialize-instance :around ((object gobject) &rest initargs) (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 @@ (defbinding %object-weak-ref (object) nil ((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))