mirror of https://github.com/swig/swig
fix #1124 - return R_NilValue for null pointer objects
This fixes #1124 and returns R_NilValue for null pointer objects
This commit is contained in:
parent
7d6808daab
commit
0b97170f1d
|
@ -6,6 +6,8 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
|||
|
||||
Version 4.0.0 (in progress)
|
||||
===========================
|
||||
2017-11-24: joequant
|
||||
Fix github #1124 and return R_NilValue for null pointers
|
||||
|
||||
2017-10-26: wsfulton
|
||||
Add support for C++11 ref-qualifiers when using directors.
|
||||
|
|
|
@ -260,6 +260,9 @@ AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output)
|
|||
/* Create a new pointer object */
|
||||
SWIGRUNTIMEINLINE SEXP
|
||||
SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
|
||||
if (!ptr) {
|
||||
return R_NilValue;
|
||||
}
|
||||
SEXP rptr = R_MakeExternalPtr(ptr,
|
||||
R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue);
|
||||
SET_S4_OBJECT(rptr);
|
||||
|
|
Loading…
Reference in New Issue