[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sc/source

David Tardon dtardon at redhat.com
Thu Jan 8 05:59:50 PST 2015


 sc/source/core/tool/token.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aa2c14d7ad8990afa25603f637c7ef2628b77873
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Oct 6 20:24:52 2014 +0200

    avoid use of ref. to possibly deleted object
    
    Change-Id: If5977b280fed8d8b053f59852d3984a59ce61a69
    (cherry picked from commit ce5cc7afb0f1c99237d04e0c754527c725d8491c)
    Reviewed-on: https://gerrit.libreoffice.org/11832
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index eb83c8c..ba01d9a 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2386,9 +2386,9 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
                     sal_uInt16 nFileId;
                     GetExternalTableData(pOldDoc, pNewDoc, rRef.Tab(), aTabName, nFileId);
                     //replace with ScExternalSingleRefToken and adjust references
-                    pCode[j]->DecRef();
                     ScExternalSingleRefToken* pToken = new ScExternalSingleRefToken(nFileId, aTabName, rRef);
                     pToken->IncRef();
+                    pCode[j]->DecRef(); // ATTENTION: rRef can't be used after this point
                     pCode[j] = pToken;
                 }
             }


More information about the Libreoffice-commits mailing list