summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-08-17 21:40:12 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-08-17 22:05:05 +0200
commit7da32109ecf9a269764603f8a8855268d5b1f8e3 (patch)
treee5e625ba1c3c50a3df38ad5febd3a31b4da037cf /basic
parentd7d9d3cf1a529cfe99fb1b5ae65967c54e9f23bb (diff)
Don't forget to increment refcount when loading from image
Otherwise it will fail assertion in SbxValue::Clear, because SvRefBase::ReleaseRef would check that its current count is not zero. In release builds, not doing this would leak. Change-Id: I80dfc815f8a2b651ff290af10808212281abf246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100879 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxvalue.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index bd668a02964d..43a8e5243c83 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1413,6 +1413,9 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
break;
case 1:
aData.pObj = SbxBase::Load( r );
+ // if necessary increment Ref-Count
+ if (aData.pObj)
+ aData.pObj->AddFirstRef();
return ( aData.pObj != nullptr );
case 2:
aData.pObj = this;