chiark / gitweb /
Doing ref. counting before sinking in around method
authorespen <espen>
Fri, 3 Feb 2006 12:47:00 +0000 (12:47 +0000)
committerespen <espen>
Fri, 3 Feb 2006 12:47:00 +0000 (12:47 +0000)
gtk/gtkobject.lisp

index 821fa04709878d69d98232bf2a28d687803605fe..31cbe9f3095d2638ff12c03420b0e41008b9a94a 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.28 2006/02/03 12:47:00 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) (proxy-location object))
   (%object-sink object))
 
 (defbinding %object-sink () nil