summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-17 18:26:56 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-04-17 19:56:07 +0200
commitc11463cdc5415707d05ab6da08736ff7212db4a0 (patch)
tree1c38a788f7f68d40cb69a5c94479297b0364085b /starmath
parent3de2980f198f4d592896f1bebae841ffbcc74c5e (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/ElementsDockingWindow.cxx2
1 files changed, 1 insertions, 1 deletions
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);