add assert in SvpSalVirtualDevice::ReleaseGraphics

so we don't ignore any mis-use of the API

Change-Id: I8a1edf589d1a2893c4fa0ccb121dd15dd8329f14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184316
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2025-04-17 10:43:05 +02:00
parent 39bd06ad1e
commit 7dc032dc3d

View File

@ -58,7 +58,8 @@ SalGraphics* SvpSalVirtualDevice::AcquireGraphics()
void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
{
std::erase(m_aGraphics, dynamic_cast<SvpSalGraphics*>(pGraphics));
assert(dynamic_cast<SvpSalGraphics*>(pGraphics));
std::erase(m_aGraphics, static_cast<SvpSalGraphics*>(pGraphics));
delete pGraphics;
}