diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-21 08:57:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-21 12:59:18 +0200 |
commit | 082b56282f60bca8f58e0c77161ea3afc2005f12 (patch) | |
tree | 4fcdb73a77acfd8910c09624364185245c7a8415 /svx/source | |
parent | a9ec212c1b545d745285f0ab3119a80713b1d1f2 (diff) |
coverity#1439599 Uninitialized pointer field
Change-Id: I083e9e01e26f294064104a4682c50a9bfc7fa09c
Reviewed-on: https://gerrit.libreoffice.org/60848
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/measctrl.cxx | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 87c0c3f38d6c..1e641d6b5d42 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -41,7 +41,7 @@ void SvxXMeasurePreview::SetDrawingArea(weld::DrawingArea* pDrawingArea) pDrawingArea->set_size_request(aSize.Width(), aSize.Height()); pModel.reset(new SdrModel(nullptr, nullptr, true)); - pMeasureObj = new SdrMeasureObj(*pModel, Point(), Point()); + pMeasureObj.reset(new SdrMeasureObj(*pModel, Point(), Point())); ResizeImpl(aSize); Invalidate(); @@ -72,17 +72,6 @@ void SvxXMeasurePreview::Resize() SvxXMeasurePreview::~SvxXMeasurePreview() { - // No one is deleting the MeasureObj? This is not only an error but also - // a memory leak (!). Main problem is that this object is still listening to - // a StyleSheet of the model which was set. Thus, if You want to keep the object, - // set the model to 0L, if object is not needed (seems to be the case here), - // delete it. - - // always use SdrObject::Free(...) for SdrObjects (!) - SdrObject* pTemp(pMeasureObj); - SdrObject::Free(pTemp); - - pModel.reset(); } void SvxXMeasurePreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) |