From: SourceForge.net <no...@so...> - 2007-07-26 07:13:39
|
Bugs item #1760795, was opened at 2007-07-26 09:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760795&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: php Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Etienne (evaillant) Assigned to: kruland (kruland) Summary: Ref count... Initial Comment: Consider the following example: t01.i: %module t01 %{ # include <iostream> # include "t01.hh" # define TRACE(arg) std::cout << __FILE__ << "(" << __LINE__ << ") : " << arg << std::endl %} %feature("ref") Pouet "TRACE(\"up ref\");" %feature("unref") Pouet "TRACE(\"down ref\");" %include "t01.hh" t01.hh: #ifndef T01_HH__ #define T01_HH__ struct Pouet { int a; }; #endif t.php: <?php include("t01.php"); $p = new Pouet(); ?> I compile with : $ swig -php4 -c++ -Wall t01.i $ g++ t01_wrap.cpp -shared -I. -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/TSRM -I/usr/include/php4/Zend -g -o t01.so And when I run it : PHP Warning: mime_magic: type regex BEGIN[[:space:]]*[{] application/x-awk invalid in Unknown on line 0 t01_wrap.cpp(1094) : down ref My problem is why there is only unref but not ref and unref. I do its test in perl5 and there is ref and unref. And I think I find the bug in swig source (version 1.3.31) (see my patch). And after its patch we can see : PHP Warning: mime_magic: type regex BEGIN[[:space:]]*[{] application/x-awk invalid in Unknown on line 0 t01_wrap.cpp(1076) : up ref t01_wrap.cpp(1095) : down ref (like perl) Etienne ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760795&group_id=1645 |