More correct usage of CLOS MOP: add call to ENSURE-FINALIZED at start of MAKE-INSTANC...
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Mon, 15 Feb 2010 21:10:36 +0000 (05:10 +0800)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 16 Feb 2010 17:49:15 +0000 (01:49 +0800)
glib/gobject.foreign-gobject-subclassing.lisp
glib/gobject.meta.lisp

index 9edba2c..423214a 100644 (file)
                                         (foreign-slot-value query 'g-type-query :instance-size)
                                         (callback c-instance-init) nil))
        (add-interfaces ,name))
-     (defmethod initialize-instance :before ((object ,class) &key pointer)
-       (log-for :subclass "(initialize-instance ~A :pointer ~A) :before~%" object pointer)
-       (unless (or pointer (and (slot-boundp object 'gobject::pointer)
-                                (gobject::pointer object)))
-         (log-for :subclass "calling g-object-constructor~%")
-         (setf (gobject::pointer object) (gobject::g-object-call-constructor ,name nil nil)
-               (gobject::g-object-has-reference object) t)))
      (progn
        ,@(iter (for (prop-name prop-type prop-accessor prop-reader prop-writer) in properties)
                (declare (ignorable prop-type))
index 120a958..fd24560 100644 (file)
 
 (defmethod make-instance ((class gobject-class) &rest initargs &key pointer)
   (log-for :subclass "(make-instance ~A ~{~A~^ ~})~%" class initargs)
+  (ensure-finalized class)
   (let ((*currently-making-object-p* t))
     (if pointer
         (progn