From commits-return-37700-apmail-openoffice-commits-archive=openoffice.apache.org@openoffice.apache.org Mon Sep 1 10:33:15 2014 Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96B7311918 for ; Mon, 1 Sep 2014 10:33:15 +0000 (UTC) Received: (qmail 88449 invoked by uid 500); 1 Sep 2014 10:33:15 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 88408 invoked by uid 500); 1 Sep 2014 10:33:15 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 88398 invoked by uid 99); 1 Sep 2014 10:33:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 10:33:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 10:32:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DC97F23889D5; Mon, 1 Sep 2014 10:32:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1621730 - /openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx Date: Mon, 01 Sep 2014 10:32:51 -0000 To: commits@openoffice.apache.org From: alg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140901103251.DC97F23889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: alg Date: Mon Sep 1 10:32:51 2014 New Revision: 1621730 URL: http://svn.apache.org/r1621730 Log: i125519 check GraphicObject existance before accessing it Modified: openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx Modified: openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx?rev=1621730&r1=1621729&r2=1621730&view=diff ============================================================================== --- openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx (original) +++ openoffice/trunk/main/svtools/source/graphic/grfmgr2.cxx Mon Sep 1 10:32:51 2014 @@ -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(); + } } } }