svx/source/svdraw/svdhdl.cxx    |    2 +-
 test/source/screenshot_test.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e55742e928343d975a4f058f7262e7447ea92573
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Feb 21 19:28:03 2026 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Feb 21 16:16:43 2026 +0100

    fix assorted VirtualDevice GDI handle leaks
    
    Similar to commit e9392c0c86fcf373e00ede92f8ceeee2c7efd233 (fix
    VirtualDevice GDI handle leaks across IconView callers, 2026-02-21).
    
    Change-Id: I5d0566a2d6c7285c6efde5560f13c1efd22cdc55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199942
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Andras Timar <[email protected]>

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index aba506b0e463..832ab56d92fb 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1172,7 +1172,7 @@ void SdrHdlColor::CreateB2dIAObject()
 BitmapEx SdrHdlColor::CreateColorDropper(Color aCol)
 {
     // get the Bitmap
-    VclPtr<VirtualDevice> pWrite(VclPtr<VirtualDevice>::Create());
+    ScopedVclPtrInstance<VirtualDevice> pWrite;
     pWrite->SetOutputSizePixel(m_aMarkerSize);
     pWrite->SetBackground(aCol);
     pWrite->Erase();
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index 3baad8b24b7a..443ffb68e377 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -121,7 +121,7 @@ void ScreenshotTest::saveScreenshot(VclAbstractDialog const 
& rDialog)
 
 void ScreenshotTest::saveScreenshot(weld::Window& rDialog)
 {
-    VclPtr<VirtualDevice> xDialogSurface(rDialog.screenshot());
+    ScopedVclPtr<VirtualDevice> xDialogSurface(rDialog.screenshot());
     const BitmapEx aScreenshot(xDialogSurface->GetBitmapEx(Point(), 
xDialogSurface->GetOutputSizePixel()));
 
     if (!aScreenshot.IsEmpty())

Reply via email to