From: SourceForge.net <no...@so...> - 2007-08-27 07:42:40
|
Bugs item #1760125, was opened at 2007-07-25 10:13 Message generated for change (Comment added) made by evaillant You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760125&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: [php] 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 ---------------------------------------------------------------------- >Comment By: Etienne (evaillant) Date: 2007-08-27 09:42 Message: Logged In: YES user_id=1852990 Originator: YES Looks as though this has been fixed in the svn version... ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2007-08-25 12:50 Message: Logged In: YES user_id=14972 Originator: NO Can you regenerate your patch with context? Without any context, I can't see where to apply the patch to SVN HEAD. Use "diff -u" (if your diff supports -u), otherwise "diff -c". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760125&group_id=1645 |