diff --git a/CHANGES.current b/CHANGES.current index 405789c12..78f01cce0 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,5 +1,9 @@ Version 1.3.32 (in progress) ============================ + +01/12/2007: wsfulton + [Php] Add support for newfree typemaps (sometimes used by %newobject) + 01/12/2007: beazley New command line option -macroerrors. When supplied, this will force the C scanner/parser to report proper location information for code contained diff --git a/Source/Modules/php4.cxx b/Source/Modules/php4.cxx index 73fdb9eb3..040bc52ff 100644 --- a/Source/Modules/php4.cxx +++ b/Source/Modules/php4.cxx @@ -1254,11 +1254,22 @@ public: if (cleanup) { Printv(f->code, cleanup, NIL); } - // What's this bit for? + + /* Look to see if there is any newfree cleanup code */ + if (GetFlag(n, "feature:new")) { + if ((tm = Swig_typemap_lookup_new("newfree", n, "result", 0))) { + Printf(f->code, "%s\n", tm); + Delete(tm); + } + } + + /* See if there is any return cleanup code */ if ((tm = Swig_typemap_lookup_new("ret", n, "result", 0))) { Printf(f->code, "%s\n", tm); + Delete(tm); } + if (mvr) { if (!mvrset) { Printf(f->code, "return _return_value;\n");