[Libreoffice-commits] core.git: chart2/source sfx2/source svx/inc sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed May 12 13:44:52 UTC 2021


 chart2/source/controller/dialogs/DataBrowser.cxx |    2 +-
 sfx2/source/dialog/infobar.cxx                   |    2 +-
 svx/inc/galbrws2.hxx                             |    2 +-
 sw/source/uibase/docvw/HeaderFooterWin.cxx       |    1 +
 sw/source/uibase/docvw/PageBreakWin.cxx          |    2 +-
 sw/source/uibase/docvw/UnfloatTableButton.cxx    |    1 +
 6 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit dad39d0022ed267ede3e8e589854f7eb73e602f3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed May 12 13:23:22 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed May 12 15:44:12 2021 +0200

    fix some VirtualDevice leaks
    
    Change-Id: I645543fa27ca8b75b36ed7798f0af7b81fd09f49
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115477
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index a5df0dcc03e4..a58d24433b75 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -302,7 +302,7 @@ void SeriesHeader::SetPos()
     aSize.setWidth(m_nWidth);
     m_spColorBar->set_size_request(aSize.Width(), aSize.Height());
 
-    auto xVirDev(m_spColorBar->create_virtual_device());
+    ScopedVclPtr<VirtualDevice> xVirDev(m_spColorBar->create_virtual_device());
     xVirDev->SetOutputSizePixel(aSize);
     xVirDev->SetFillColor(m_aColor);
     xVirDev->SetLineColor(m_aColor);
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 3af15ee3f62c..40095a7b8a25 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -101,7 +101,7 @@ void SfxInfoBarWindow::SetCloseButtonImage()
     Size aSize = Image(StockImage::Yes, CLOSEDOC).GetSizePixel();
     aSize = Size(aSize.Width() * 1.5, aSize.Height() * 1.5);
 
-    VclPtr<VirtualDevice> xDevice(m_xCloseBtn->create_virtual_device());
+    ScopedVclPtr<VirtualDevice> xDevice(m_xCloseBtn->create_virtual_device());
     xDevice->SetOutputSizePixel(aSize);
 
     Point aBtnPos(0, 0);
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index 088013946d22..a81e2b3fc234 100644
--- a/svx/inc/galbrws2.hxx
+++ b/svx/inc/galbrws2.hxx
@@ -85,7 +85,7 @@ private:
     std::unique_ptr<weld::ToggleButton> mxIconButton;
     std::unique_ptr<weld::ToggleButton> mxListButton;
     std::unique_ptr<weld::Label> mxInfoBar;
-    VclPtr<VirtualDevice> mxDev;
+    ScopedVclPtr<VirtualDevice> mxDev;
     Size maPreviewSize;
     rtl::Reference<GalleryTransferable> m_xHelper;
     sal_uInt32 mnCurActionPos;
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 2232c7b8d4cd..d8ae3e80d062 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -207,6 +207,7 @@ void SwHeaderFooterWin::dispose()
     m_pLine.disposeAndClear();
     m_xPushButton.reset();
     m_xMenuButton.reset();
+    m_xVirDev.disposeAndClear();
     SwFrameMenuButtonBase::dispose();
 }
 
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 535f02b85a25..7a9022e01778 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -134,7 +134,7 @@ void SwPageBreakWin::dispose()
 {
     m_bDestroyed = true;
     m_aFadeTimer.Stop();
-
+    m_xVirDev.disposeAndClear();
     m_pLine.disposeAndClear();
 
     m_xMenuButton.reset();
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index 24e6780e1ed2..803c851a5dbb 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -61,6 +61,7 @@ UnfloatTableButton::~UnfloatTableButton() { disposeOnce(); }
 void UnfloatTableButton::dispose()
 {
     m_xPushButton.reset();
+    m_xVirDev.disposeAndClear();
     SwFrameMenuButtonBase::dispose();
 }
 


More information about the Libreoffice-commits mailing list