Closed igorcalabria closed 3 years ago
If free-from-foreign is false, mem-get will return NIL when it should return the actual object: https://github.com/andy128k/cl-gobject-introspection/blob/master/src/function.lisp#L312
free-from-foreign
mem-get
Here's my fix
(if-let ((obj (build-object-ptr gir-class ptr))) (if free-from-foreign (object-setup-gc obj :everything) obj))))))
I think this was just a small mistake with the position of obj, since it was on the ELSE-FORM of the if-let macro. If this was a plain "let", the previous version would be just fine since obj would be returned either way.
Thanks a lot!
If
free-from-foreign
is false,mem-get
will return NIL when it should return the actual object: https://github.com/andy128k/cl-gobject-introspection/blob/master/src/function.lisp#L312Here's my fix
I think this was just a small mistake with the position of obj, since it was on the ELSE-FORM of the if-let macro. If this was a plain "let", the previous version would be just fine since obj would be returned either way.