[Libreoffice-commits] core.git: basic/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 17 20:05:44 UTC 2020
basic/source/sbx/sbxvalue.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 7da32109ecf9a269764603f8a8855268d5b1f8e3
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Aug 17 21:40:12 2020 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Aug 17 22:05:05 2020 +0200
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 at collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
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;
More information about the Libreoffice-commits
mailing list