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 <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199950
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski
2026-02-21 19:58:29 +01:00
parent 566ae8a3b9
commit 99c2cc0673
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1172,7 +1172,7 @@ void SdrHdlColor::CreateB2dIAObject()
Bitmap 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();
+1 -1
View File
@@ -124,7 +124,7 @@ void ScreenshotTest::saveScreenshot(VclAbstractDialog const & rDialog)
void ScreenshotTest::saveScreenshot(weld::Window& rDialog)
{
VclPtr<VirtualDevice> xDialogSurface(rDialog.screenshot());
ScopedVclPtr<VirtualDevice> xDialogSurface(rDialog.screenshot());
const Bitmap aScreenshot(xDialogSurface->GetBitmap(Point(), xDialogSurface->GetOutputSizePixel()));
if (!aScreenshot.IsEmpty())