(probably) fix the error in refcount
[cl-gtk2.git] / glib / gobject.foreign-gobject.lisp
index a4cad2b..0ea990a 100644 (file)
     (unless lisp-type
       (error "Type ~A is not registered with REGISTER-OBJECT-TYPE"
              (g-type-name g-type)))
+    (g-object-ref pointer)
     (make-instance lisp-type :pointer pointer)))
 
 (define-foreign-type foreign-g-object-type ()
 
 (defmethod translate-to-foreign (object (type foreign-g-object-type))
   (cond
+    ((null object)
+     (null-pointer))
     ((null (pointer object))
      (error "Object ~A has been disposed" object))
     ((typep object 'g-object)