summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
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