What steps will reproduce the problem?
1. Declare a class with [binding_model=by_pointer]
2. Define a nullable return value on a member function.
In my case:
[binding_model=by_pointer] class MyClass {
...
[static] MyObject? myFunction(int x);
}
Despite explicitly declaring this member as nullable, a wrapper object is
always returned.
The cause of this is the function GetNPObject defined in
by_pointer_binding.py which ignores the passed value and always returns the
proxy wrapper object. This is easily fixed with the one line change below.
--- a/plugin/third_party/nixysa/by_pointer_binding.py
+++ b/plugin/third_party/nixysa/by_pointer_binding.py
@@ -334,6 +334,7 @@ static void Deallocate(NPObject *header) {
}
NPAPIObject *GetNPObject(NPP npp, ${Class} *object) {
+ if(object == NULL) return NULL;
NPAPIObject *npobject = static_cast<NPAPIObject *>(
NPN_CreateObject(npp, &npclass));
npobject->set_value(object);
Original issue reported on code.google.com by aaron...@gmail.com on 25 Aug 2009 at 11:01
Original issue reported on code.google.com by
aaron...@gmail.com
on 25 Aug 2009 at 11:01