[PHP] Fix memory leak in PHP resource destructor for classes
without a destructor and non-class types. Patch from Hitoshi Amano in SF#2825303. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11463 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c321421bc5
commit
4b7478ac15
2 changed files with 7 additions and 0 deletions
|
|
@ -158,9 +158,11 @@ void SwigPHP_emit_resource_registrations() {
|
|||
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
|
||||
Printf(s_wrappers, " efree(rsrc->ptr);\n");
|
||||
}
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
|
||||
Printf(s_wrappers, " efree(rsrc->ptr);\n");
|
||||
}
|
||||
|
||||
// close function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue