From: Jozef M. <mis...@ho...> - 2008-01-21 23:13:34
|
there are several places where std::erase+iterators are not used correctly= =20 =20 please correct it you can use the provided patch =20 jozo =20 Index: cpdf.cc=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DRCS file:= /cvsroot/pdfedit/pdfedit/src/kernel/cpdf.cc,vretrieving revision 1.86.2.1d= iff -u -r1.86.2.1 cpdf.cc--- cpdf.cc 18 Jan 2008 00:46:05 -0000 1.86.2.1+++= cpdf.cc 21 Jan 2008 22:45:22 -0000@@ -2401,7 +2401,7 @@ IndiRef ref=3D= getValueFromSimple<CRef>(oldValue); bool found=3Dfalse;- for(Pa= geList::iterator i=3DpageList.begin(); i!=3DpageList.end(); ++i)+ for(Pa= geList::iterator i=3DpageList.begin(); i!=3DpageList.end();) { sha= red_ptr<CPage> page=3Di->second; // checks page's dictionary whether i= t is in oldDict_ptr sub@@ -2419,16 +2419,19 @@ page->invalidate(); = // NOTE: std::map keeps iterators following iterators // valid a= fter removing- pageList.erase(i);+ pageList.erase(i++); ker= nelPrintDbg(DBG_INFO, "CPage(pos=3D"<<pos<<") associated with oldValue page= dictionary removed. pageList.size=3D"<<pageList.size()); }else+ = { // if this element is not in subtree and found is true, // th= is is first node which is in different node and so // none of followi= ng pages can be descendant (PageList // is sorted) if(found) = break;+ ++i;+ } } break; }@@ -2496,7 +2499,7 @@ = // all pages with position greater than minPos, has to be consolidated Pag= eList::iterator i; PageList readdContainer;- for(i=3DpageList.begin(); i!= =3DpageList.end(); ++i)+ for(i=3DpageList.begin(); i!=3DpageList.end();) {= size_t pos=3Di->first; shared_ptr<CPage> page=3Di->second;@@ -2505,8 += 2508,9 @@ { // collects all removed readdContainer.insert(PageList:= :value_type(pos, page)); - pageList.erase(i);- }+ pageList.erase(i++);= + }else+ ++i; } // checks minPos=3D=3D0 and if so, we have to handle= situation special way, _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=3DTXT_TAGHM_Wave2_sharelife_0120= 08= |