svx/source/svdraw/svdouno.cxx | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 1a86be908952aea376d37473adbab091a5440a35
Author: Noel Grandin <[email protected]>
AuthorDate: Sun Oct 9 10:05:51 2022 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Sun Oct 9 12:09:46 2022 +0200
tdf#151417 crash in draw, activating Form controls
regression from
commit 8611f6e259b807b4f19c8dc0eab86ca648891ce3
Author: Noel Grandin <[email protected]>
Date: Thu May 27 10:27:46 2021 +0200
ref-count SdrObject
Change-Id: I1798cead8ed72ad59799c40d0e99f3424f9e382b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 09de889e33e2..82832c98b620 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -139,6 +139,7 @@ SdrUnoObj::SdrUnoObj(
: SdrRectObj(rSdrModel),
m_pImpl( new SdrUnoObjDataHolder )
{
+ osl_atomic_increment(&m_refCount); // prevent deletion during creation
m_bIsUnoObj = true;
m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
@@ -146,6 +147,7 @@ SdrUnoObj::SdrUnoObj(
// only an owner may create independently
if (!rModelName.isEmpty())
CreateUnoControlModel(rModelName);
+ osl_atomic_decrement(&m_refCount);
}
SdrUnoObj::SdrUnoObj( SdrModel& rSdrModel, SdrUnoObj const & rSource)