Author: alg Date: Sun May 31 15:30:16 2015 New Revision: 1682743 URL: http://svn.apache.org/r1682743 Log: #125519# applied fix for branch AOO410
Modified: openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx (contents, props changed) Modified: openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx?rev=1682743&r1=1682742&r2=1682743&view=diff ============================================================================== --- openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx (original) +++ openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx Sun May 31 15:30:16 2015 @@ -358,8 +358,33 @@ void GraphicManager::ImplCheckSizeOfSwap // do not swap out when we have less than 16KB data objects if(nSizeBytes >= (16 * 1024)) { - pObj->FireSwapOutRequest(); - nUsedSize = (nSizeBytes < nUsedSize) ? nUsedSize - nSizeBytes : 0; + // #125519# need to check if GraphicObject is still alive + GraphicObject* pObj2 = 0; + bool bExists(false); + + for(pObj2 = (GraphicObject*)maObjList.First(); !bExists && pObj2; pObj2 = (GraphicObject*)maObjList.Next()) + { + if(pObj2 && pObj2 == pObj) + { + bExists = true; + } + } + + if(bExists) + { + // #125519# okay, swap it out + pObj->FireSwapOutRequest(); + nUsedSize = (nSizeBytes < nUsedSize) ? nUsedSize - nSizeBytes : 0; + } + else + { + // #125519# error: object was deleted while still a member in aCandidates. This means that + // an earlier call to pObj->FireSwapOutRequest() on an other GraphicObject has as + // a side effect *deleted* and thus removed another GraphicObject from the local + // list (maObjList). This must of course be avoided. + // To check without need to run in debugger, optionally temporarily reactivate the beep below + // Sound::Beep(); + } } } } Propchange: openoffice/branches/AOO410/main/svtools/source/graphic/grfmgr2.cxx ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Sun May 31 15:30:16 2015 @@ -0,0 +1,5 @@ +/openoffice/branches/AOO400/main/svtools/source/graphic/grfmgr2.cxx:1503684 +/openoffice/branches/ia2/main/svtools/source/graphic/grfmgr2.cxx:1417739-1541842 +/openoffice/branches/ooxml-osba/main/svtools/source/graphic/grfmgr2.cxx:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283 +/openoffice/branches/rejuvenate01/main/svtools/source/graphic/grfmgr2.cxx:1480411,1534063,1534098,1536312,1549902,1560617 +/openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx:1571617,1571677,1572569,1572577,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585261,1586242,1586249,1586583,1587468,1589050,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602823,1602850,1603416,1603897,1603941,1604028,1604709,1604786,1605044,1605355,1605689,1606055,1606061,1606706,1607111,1607793,1607836,1608348,1608376,1608730,1608733,1609204,1609208,1609302,1609426,1610347,1610411,1610422,1610671,1611470,1611549,1612070-1612071,1612539,1612801,1616457,1616944,1621730