chiark
/
gitweb
/
~mdw
/
clg
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Object finalization optimized
[clg]
/
glib
/
gobject.lisp
diff --git
a/glib/gobject.lisp
b/glib/gobject.lisp
index 3f1b348d69c224643ba877595a5301689ec5e77c..2370ebd5d4599a3f6afa73bda0a4b2bbd44823d6 100644
(file)
--- 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
;; 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")
(in-package "GLIB")
@@
-205,6
+205,13
@@
(defmethod initialize-instance :around ((object gobject) &rest initargs)
(call-next-method)
(%object-weak-ref object))
(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)))
(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))
((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))
(defbinding (%gobject-new "g_object_new") () pointer
(type type-number)
(nil null))