summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-13 16:41:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-13 20:26:07 +0200
commit2ebf40bc1d721467f2441bf83aa7d47bc12b0434 (patch)
tree2d89335014c2032be2538238f1974b0cc4820b62 /sd/source
parent8aaa28ed43978a9a4a20d62368410a57ec05c23f (diff)
ofz#34297 Indirect-leak
this is similar to the memory leak fixed by commit d6e752d5ebfaf66d1c9b0694f9c8582311d6151a Author: Jian Fang Zhang <zhangjf@apache.org> Date: Mon Jun 18 12:26:30 2012 +0000 i#113608#, memory leak in animations: newly exposed crashed problem where the parent node holds a reference to its children and the child held a reference to its parent. Change RandomAnimationNode to use a WeakReference to its parent like the other AnimationNodes do Change-Id: I251a6127c301d1fb7e51397d8f05db4020bc612c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117096 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/unoidl/randomnode.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx
index 86c973336101..a87ae1783721 100644
--- a/sd/source/ui/unoidl/randomnode.cxx
+++ b/sd/source/ui/unoidl/randomnode.cxx
@@ -33,6 +33,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weakref.hxx>
#include <osl/mutex.hxx>
#include <CustomAnimationPreset.hxx>
#include <randomnode.hxx>
@@ -45,6 +46,7 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::XInterface;
+using ::com::sun::star::uno::WeakReference;
using ::com::sun::star::beans::NamedValue;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::container::XEnumeration;
@@ -58,6 +60,7 @@ using ::com::sun::star::presentation::ParagraphTarget;
using ::com::sun::star::drawing::XShape;
using namespace ::com::sun::star::animations;
+
namespace sd
{
@@ -139,7 +142,7 @@ private:
Mutex maMutex;
sal_Int16 mnPresetClass;
- Reference< XInterface > mxParent;
+ WeakReference<XInterface> mxParent;
Any maBegin, maDuration, maEnd, maEndSync, maRepeatCount, maRepeatDuration, maTarget;
sal_Int16 mnFill, mnFillDefault, mnRestart, mnRestartDefault;
@@ -426,7 +429,7 @@ void SAL_CALL RandomAnimationNode::setUserData( const Sequence< NamedValue >& _u
Reference< XInterface > SAL_CALL RandomAnimationNode::getParent()
{
Guard< Mutex > aGuard( maMutex );
- return mxParent;
+ return mxParent.get();
}
// XChild