chiark / gitweb /
Work around for broken def-type-method
[clg] / gtk / gtkobject.lisp
index 68c2db97e0637851f018c375eb4a037ed24c7c54..bdc6c189d73ec99c4f3e47568005e0f569e330de 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gtkobject.lisp,v 1.27 2005-04-23 16:48:52 espen Exp $
+;; $Id: gtkobject.lisp,v 1.31 2006-02-15 09:47:42 espen Exp $
 
 
 (in-package "GTK")
@@ -52,13 +52,15 @@   (defclass %object (gobject)
 (defmethod initialize-instance ((object %object) &rest initargs &key signal)
   (declare (ignore signal))
   (call-next-method)
-  (reference-foreign (class-of object) (proxy-location object))
   (dolist (signal-definition (get-all initargs :signal))
     (apply #'signal-connect object signal-definition)))
 
 (defmethod initialize-instance :around ((object %object) &rest initargs)
   (declare (ignore initargs))
   (call-next-method)
+  ;; Add a temorary reference which will be removed when the object is
+  ;; sinked
+  (reference-foreign (class-of object) (foreign-location object))
   (%object-sink object))
 
 (defbinding %object-sink () nil
@@ -123,9 +125,11 @@ (defmethod effective-slot-definition-class ((class child-class) &rest initargs)
     (t (call-next-method))))
 
 (defmethod compute-effective-slot-definition-initargs ((class child-class) direct-slotds)
-  (if (eq (most-specific-slot-value direct-slotds 'allocation) :property)
+  (if (eq (slot-definition-allocation (first direct-slotds)) :property)
       (nconc 
        (list :pname (most-specific-slot-value direct-slotds 'pname))
+       ;; Need this to prevent type expansion in SBCL (>= 0.9.8)
+       (list :type (most-specific-slot-value direct-slotds 'type))
        (call-next-method))
     (call-next-method)))