[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:
Olly Betts 2009-07-29 02:06:18 +00:00
commit 4b7478ac15
2 changed files with 7 additions and 0 deletions

View file

@ -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