diff options
-rw-r--r-- | basic/source/runtime/runtime.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 9424482da487..0c9a17369729 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -2201,6 +2201,9 @@ static void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, sa else { SbxVariable* pSource = pOldArray->Get32( pActualIndices ); + if (pSource && pOldArray->GetRefCount() > 1) + // tdf#134692: old array will stay alive after the redim - we need to copy deep + pSource = new SbxVariable(*pSource); pNewArray->Put32(pSource, pActualIndices); } } |