From: SourceForge.net <no...@so...> - 2011-02-18 06:53:28
|
Bugs item #3175820, was opened at 2011-02-09 07:13 Message generated for change (Settings changed) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3175820&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: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Cory Bennett (perlmonkey) Assigned to: Olly Betts (olly) Summary: [php] director uses invalid iterator Initial Comment: in trunk/Lib/php/director.swg there is: ~Director() { for (swig_ownership_map::iterator i = swig_owner.begin(); i != swig_owner.end(); i++) { swig_owner.erase(i); } } The i++ after the erase is invalid use of an std::map iterator. The erase invalidates the iterator. It seems that this code should be written without the loop as: ~Director() { swig_owner.clear(); } I have attached a patch. Thanks -Cory ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2011-02-18 18:32 Message: That works, so applied in r12469. ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2011-02-18 18:09 Message: Unless I'm missing something, we don't actually need an explicit destructor here at all! The swig_owner member will be destoyed when the object is, and that will call any destructors on objects in the map. Testing that change now... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3175820&group_id=1645 |