Support Disown functionality.
Creating newobject variable under struct which stores this pointer. Using that to implement Disown.
This commit is contained in:
parent
4458040975
commit
290198495f
2 changed files with 21 additions and 6 deletions
|
|
@ -141,8 +141,14 @@
|
|||
|
||||
%typemap(in) SWIGTYPE *DISOWN
|
||||
%{
|
||||
$arg2if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN ) < 0)
|
||||
$arg2SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
|
||||
if (zend_lookup_class(zend_string_init("$lower_param",sizeof("$lower_param")-1,0))) {
|
||||
Z_$upper_param_OBJ_P(&$input)->newobject = 0;
|
||||
$1 = Z_$upper_param_OBJ_P(&$input)->$lower_param_obj;
|
||||
}
|
||||
else {
|
||||
if (SWIG_ConvertPtr(&$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN ) < 0)
|
||||
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(argout) SWIGTYPE *,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue