starmath/source/ElementsDockingWindow.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c11463cdc5415707d05ab6da08736ff7212db4a0
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Apr 17 18:26:56 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Apr 17 19:56:07 2023 +0200

    tdf#154016: use ScopedVclPtr
    
    A regression crash from commit d79c527c2a599c7821d27cf03b95cb79e2abe685
    (Use IconView in SmElementsControl, 2022-06-01). Without disposeAndClear,
    the VirtualDevices leak; and on Windows this quickly leads to GDI handle
    10 000 limit killing the process (which is good, helping to track this
    kind of issues).
    
    Change-Id: I28e1ffbeb425fae3fdbd76b7873fef5c929b8e11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150523
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 16a22d27aa00..b2186a7ecbf9 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -527,7 +527,7 @@ namespace
 void SmElementsControl::addElement(const OUString& aElementVisual, const 
OUString& aElementSource, const OUString& aHelpText)
 {
     std::unique_ptr<SmNode> pNode = maParser->ParseExpression(aElementVisual);
-    VclPtr<VirtualDevice> pDevice(mpIconView->create_virtual_device());
+    ScopedVclPtr<VirtualDevice> pDevice(mpIconView->create_virtual_device());
     pDevice->SetMapMode(MapMode(SmMapUnit()));
     pDevice->SetDrawMode(DrawModeFlags::Default);
     pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);

Reply via email to