summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-10-06 20:24:52 +0200
committerEike Rathke <erack@redhat.com>2014-10-08 14:02:45 +0000
commitfa00d2ec45aa24a433b832c5287f3e8f41475326 (patch)
tree558fc3e23f25b2c4dcb9cdb1b3d69ab96c33b8ef
parent8a6275b0b92d959f0b440a73362c7ec0eea4436e (diff)
avoid use of ref. to possibly deleted object
Change-Id: If5977b280fed8d8b053f59852d3984a59ce61a69 (cherry picked from commit ce5cc7afb0f1c99237d04e0c754527c725d8491c) Reviewed-on: https://gerrit.libreoffice.org/11831 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/token.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8263380518d7..916a88eb8790 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2396,9 +2396,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;
}
}