From 9f88801914b0f643c5a244f68e5c5f31a27a1d9d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 12 Jan 2007 23:41:49 +0000 Subject: [PATCH] add support for newfree typemaps in php module git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9640 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 4 ++++ Source/Modules/php4.cxx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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");