summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-03-05 19:29:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-06 14:38:08 +0100
commit9dee54299cb5c6877f68b061c47bb907df90ddcc (patch)
tree2ec6202fe4ba99f92625f673615361de1f8ec4a1 /sd/source
parent82f9e12b737b3dbdf8cb9175c94d61005b666725 (diff)
clear UserCall in SdPage destructor
because I want to ref-count SdrObject, which changes the lifecycles of these objects, and then if an SdPage dies before an SdrObject we have a dangling m_pUserCall pointer. Change-Id: Ia08178c1b2f288f6d9d489fb9fd79e67bc3ea61c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/sdpage.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 5221fd718c54..38318f29455e 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -176,6 +176,15 @@ SdPage::~SdPage()
clearChildNodes(mxAnimationNode);
+ // disconnect the UserCall link
+ SdrObjListIter aIter( this, SdrIterMode::DeepWithGroups );
+ while( aIter.IsMore() )
+ {
+ SdrObject* pChild = aIter.Next();
+ if( pChild->GetUserCall() == this )
+ pChild->SetUserCall(nullptr);
+ }
+
// clear SdrObjects with broadcasting
ClearSdrObjList();
}