Open jasom opened 6 years ago
I think you can skip the null check, and just check for null-pointer. The C function can never return a Lisp NIL object.
(unless (cffi:null-pointer-p param-spec))
(parse-g-param-spec param-spec))
@jasom If you change the let*
in there to a let
only - ... and then make a PR to https://github.com/Ferada/cl-cffi-gtk because I'm maintaining that somewhat - I'd be happy to merge it.
You can't skip the nil check, if one passes nil to null-pointer-p it raises a type error
The value
NIL
is not of type
SB-SYS:SYSTEM-AREA-POINTER
when binding CFFI-SYS::PTR
[Condition of type TYPE-ERROR]
(and g-object-class-find-property
returns nil when the property is not found
@Ferada I put a PR in to your fork. I changed the let*
but left the nil check in per @PuercoPop's comment
@PuercoPop: re null-pointer-p parameter - Thanks, I missed that! You made my life a little bit better!
This caused a null-pointer dereference as a race condition in nEXT