+(defmethod slot-unbound (metaclass (class gobject-class) (slot (eql 'ref)))
+ (assert (class-direct-superclasses class))
+ (setf (slot-value class 'ref)
+ #?-(pkg-exists-p "glib-2.0" :atleast-version "2.10.0") '%object-ref
+ #?(pkg-exists-p "glib-2.0" :atleast-version "2.10.0")
+ ;; We do this hack instead of creating a new metaclass to avoid
+ ;; breaking backward compatibility
+ (if (subtypep (class-name class) 'initially-unowned)
+ '%object-ref-sink
+ '%object-ref)))
+
+(defmethod slot-unbound (metaclass (class gobject-class) (slot (eql 'unref)))
+ (setf (slot-value class 'unref) '%object-unref))
+
+