-(defcallback toggle-ref-callback (nil (data pointer) (location pointer) (last-ref-p boolean))
- (if last-ref-p
- (cache-instance (find-cached-instance location) t)
- (cache-instance (find-cached-instance location) nil)))
-
-#+gtk2.8
-(defbinding %object-add-toggle-ref () pointer
- (location pointer)
- ((callback toggle-ref-callback) pointer)
- (nil null))
-
-#+gtk2.8
-(defbinding %object-remove-toggle-ref () pointer
- (location pointer)
- ((callback toggle-ref-callback) pointer)
- (nil null))
+#+glib2.8
+(progn
+ (defcallback toggle-ref-callback (nil (data pointer) (location pointer) (last-ref-p boolean))
+ #+debug-ref-counting
+ (if last-ref-p
+ (format t "Object at 0x~8,'0X has no foreign references~%" (sap-int location))
+ (format t "Foreign reference added to object at 0x~8,'0X~%" (sap-int location)))
+ (if last-ref-p
+ (cache-instance (find-cached-instance location) t)
+ (cache-instance (find-cached-instance location) nil)))
+
+ (defbinding %object-add-toggle-ref () pointer
+ (location pointer)
+ ((callback toggle-ref-callback) pointer)
+ (nil null))
+
+ (defbinding %object-remove-toggle-ref () pointer
+ (location pointer)
+ ((callback toggle-ref-callback) pointer)
+ (nil null)))