glib: return NIL when g-object foreign type with :already-referenced receives null...
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Thu, 29 Oct 2009 12:30:01 +0000 (15:30 +0300)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Thu, 29 Oct 2009 12:30:01 +0000 (15:30 +0300)
glib/gobject.object.high.lisp

index 887ea2d..80399b8 100644 (file)
 
 (defmethod translate-from-foreign (pointer (type foreign-g-object-type))
   (let ((object (get-g-object-for-pointer pointer)))
-    (when (foreign-g-object-type-already-referenced type)
+    (when (and object (foreign-g-object-type-already-referenced type))
       (g-object-unref (pointer object)))
     object))