Fix director_basic test case
- This fixes director_basic test case. Uses the new flow in director class methods. - It also correctly fixes the double free problem in director_detect.
This commit is contained in:
parent
9451f52f74
commit
7e66388cf3
2 changed files with 12 additions and 3 deletions
|
|
@ -411,7 +411,7 @@
|
||||||
SWIGTYPE &,
|
SWIGTYPE &,
|
||||||
SWIGTYPE &&
|
SWIGTYPE &&
|
||||||
%{
|
%{
|
||||||
SWIG_SetPointerZval($input, (void *)&$1, $1_descriptor, ($owner)|2);
|
SWIG_SetZval($input, $needNewFlow, $owner, (void *)&$1, $1_descriptor, $zend_obj);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(out, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*)
|
%typemap(out, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*)
|
||||||
|
|
@ -450,7 +450,7 @@
|
||||||
|
|
||||||
%typemap(directorin) SWIGTYPE
|
%typemap(directorin) SWIGTYPE
|
||||||
%{
|
%{
|
||||||
SWIG_SetPointerZval($input, SWIG_as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&1_descriptor, 1|2);
|
SWIG_SetZval($input, $needNewFlow, $owner, SWIG_as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&1_descriptor, $zend_obj);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(out) void "";
|
%typemap(out) void "";
|
||||||
|
|
|
||||||
|
|
@ -3429,6 +3429,15 @@ done:
|
||||||
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
if ((tm = Getattr(p, "tmap:directorin")) != 0) {
|
||||||
String *parse = Getattr(p, "tmap:directorin:parse");
|
String *parse = Getattr(p, "tmap:directorin:parse");
|
||||||
if (!parse) {
|
if (!parse) {
|
||||||
|
if (is_class(Getattr(p, "type"))) {
|
||||||
|
String *return_class_name = get_class_name(Getattr(p, "type"));
|
||||||
|
String *object_name = NewStringEmpty();
|
||||||
|
Printf(object_name, "%s_object_new(SWIGTYPE_%s_ce)", return_class_name, return_class_name);
|
||||||
|
Replaceall(tm, "$zend_obj", object_name);
|
||||||
|
Replaceall(tm, "$needNewFlow", "1");
|
||||||
|
}
|
||||||
|
Replaceall(tm, "$zend_obj", "NULL");
|
||||||
|
Replaceall(tm, "$needNewFlow", "0");
|
||||||
String *input = NewStringf("&args[%d]", idx++);
|
String *input = NewStringf("&args[%d]", idx++);
|
||||||
Setattr(p, "emit:directorinput", input);
|
Setattr(p, "emit:directorinput", input);
|
||||||
Replaceall(tm, "$input", input);
|
Replaceall(tm, "$input", input);
|
||||||
|
|
@ -3517,7 +3526,7 @@ done:
|
||||||
char temp[24];
|
char temp[24];
|
||||||
sprintf(temp, "%d", idx);
|
sprintf(temp, "%d", idx);
|
||||||
Replaceall(tm, "$argnum", temp);
|
Replaceall(tm, "$argnum", temp);
|
||||||
Replaceall(tm, "$needNewFlow", "1");
|
Replaceall(tm, "$needNewFlow", Getattr(n, "feature:new") ? "1" : "0");
|
||||||
|
|
||||||
/* TODO check this */
|
/* TODO check this */
|
||||||
if (Getattr(n, "wrap:disown")) {
|
if (Getattr(n, "wrap:disown")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue