From: Dmitry Kalyanov Date: Mon, 15 Feb 2010 21:10:36 +0000 (+0800) Subject: More correct usage of CLOS MOP: add call to ENSURE-FINALIZED at start of MAKE-INSTANC... X-Git-Url: http://repo.macrolet.net/gitweb/?p=cl-gtk2.git;a=commitdiff_plain;h=cbd38328bc0e1c3d1585b41443cc9a1840bd2cf5 More correct usage of CLOS MOP: add call to ENSURE-FINALIZED at start of MAKE-INSTANCE for GOBJECT-CLASS --- diff --git a/glib/gobject.foreign-gobject-subclassing.lisp b/glib/gobject.foreign-gobject-subclassing.lisp index 9edba2c..423214a 100644 --- a/glib/gobject.foreign-gobject-subclassing.lisp +++ b/glib/gobject.foreign-gobject-subclassing.lisp @@ -223,13 +223,6 @@ (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)) diff --git a/glib/gobject.meta.lisp b/glib/gobject.meta.lisp index 120a958..fd24560 100644 --- a/glib/gobject.meta.lisp +++ b/glib/gobject.meta.lisp @@ -245,6 +245,7 @@ (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