sw/source/core/unocore/unoportenum.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 51c558930a261a5bd63569965fe360f316b9f3f4
Author:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
AuthorDate: Sun Sep 11 17:30:32 2022 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Sep 13 20:54:10 2022 +0200

    tdf#129163: GC cursor table at the end of the life of an portion enumeration
    
    Change-Id: I864c0ba9ec43a5b164bb9a118911e0507f2a538a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139778
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 2bb92469c9f6074f7d969ebe0323b623631dd3e8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139836
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 30a24721b031..be3ee4491e9e 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -337,7 +337,11 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
 SwXTextPortionEnumeration::~SwXTextPortionEnumeration()
 {
     SolarMutexGuard aGuard;
-    m_pUnoCursor.reset(nullptr);
+    if( m_pUnoCursor )
+    {
+        m_pUnoCursor->GetDoc().cleanupUnoCursorTable();
+        m_pUnoCursor.reset(nullptr);
+    }
 }
 
 sal_Bool SwXTextPortionEnumeration::hasMoreElements()

Reply via email to