summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-04 19:27:19 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-05 17:48:03 +0100
commitb22f665e2337ab019ec727f6d4a4d4c3e7b9453b (patch)
tree546dbaf54e9eff2169fcaa4b25e10dc379b25b5c /sw
parent74723bbe6b860e54c26711c108f1e2d2388e8feb (diff)
sw: ~SwDoc: delete TOXTypes after TOXMarks
warn:sw.core:24584:24584:sw/source/core/attr/calbck.cxx:156: lost a client of type: 9SwTOXMark at 0x57728d0 still registered on type: 8SwModify at 0x55a9c70. soffice.bin: sw/source/core/attr/calbck.cxx:159: virtual SwModify::~SwModify(): Assertion `!hasListenersOnDeath' failed. Change-Id: I118426e802e7f7346e579b807a4d8c85252ffeb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124757 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docnew.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index c0a03a5b4c18..a59e1687ad67 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -470,11 +470,6 @@ SwDoc::~SwDoc()
delete pTmp;
}
- for(const auto& pType : *mpTOXTypes)
- pType->CallSwClientNotify(sw::DocumentDyingHint());
- mpTOXTypes->clear();
- mpDefTOXBases.reset();
-
// Any of the FrameFormats can still have indices registered.
// These need to be destroyed now at the latest.
for( SwFrameFormat* pFormat : *mpFrameFormatTable )
@@ -498,6 +493,14 @@ SwDoc::~SwDoc()
m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
+ // clear TOX after nodes - TOXMarks are gone now so SwTOXType has no clients
+ for (const auto& pType : *mpTOXTypes)
+ {
+ pType->CallSwClientNotify(sw::DocumentDyingHint());
+ }
+ mpTOXTypes->clear();
+ mpDefTOXBases.reset();
+
// Delete Formats, make it permanent some time in the future
// Delete for Collections