diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-15 12:34:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-16 21:58:15 +0200 |
commit | 59ef304cff3b363fdcbf8bc56762c9349de78d24 (patch) | |
tree | 776b6767acdf7466ce6e1398fb12e9edba6e7c45 /svx | |
parent | 8eaf34001f76008488208bc157903c7d457238b7 (diff) |
ofz#7469 leak of SdrObject owned by SvxShape
SvxShape::InvalidateSdrObject is called and mpSdrObjectWeakReference
is reset. HasSdrObjectOwnership is only true if HasSdrObject is true
and HasSdrObject is true only if mpSdrObjectWeakReference is set.
So if mpSdrObjectWeakReference is reset in Invalidate when HasSdrObjectOwnership
is true, the shape becomes inconsistent
Change-Id: I0031c0dac33923367a2f73fcb8fe2eeb88a08db9
Reviewed-on: https://gerrit.libreoffice.org/54368
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 33299173e71e..1ea93dde6d34 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -247,6 +247,9 @@ void SvxShape::InvalidateSdrObject() EndListening(GetSdrObject()->getSdrModelFromSdrObject()); } + if (HasSdrObjectOwnership()) + return; + mpSdrObjectWeakReference.reset( nullptr ); }; |