summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/fly.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout/fly.cxx')
-rw-r--r--sw/source/core/layout/fly.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 7e6876432a67..e87b5a06dae7 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -376,8 +376,14 @@ void SwFlyFrame::FinitDrawObj()
}
}
}
- GetVirtDrawObj()->SetUserCall(nullptr); // Else calls delete of the ContactObj
- delete GetVirtDrawObj(); // Deregisters itself at the Master
+
+ // Else calls delete of the ContactObj
+ GetVirtDrawObj()->SetUserCall(nullptr);
+
+ // Deregisters itself at the Master
+ // always use SdrObject::Free(...) for SdrObjects (!)
+ SdrObject* pTemp(GetVirtDrawObj());
+ SdrObject::Free(pTemp);
}
void SwFlyFrame::ChainFrames( SwFlyFrame *pMaster, SwFlyFrame *pFollow )