kde5: avoid crash with null surface

Change-Id: Ie63e62995bee0fd950cea0668f5ae06c903b25a3
This commit is contained in:
Katarina Behrens
2017-10-04 21:57:56 +02:00
committed by Thorsten Behrens
parent 72c28fb1be
commit 637bbffa30

View File

@@ -340,7 +340,8 @@ void KDE5SalFrame::ReleaseGraphics( SalGraphics *pGraphics )
if( m_aGraphics[i].pGraphics.get() == pGraphics )
{
m_aGraphics[i].bInUse = false;
cairo_surface_destroy( m_aGraphics[i].pSurface );
if ( m_aGraphics[i].pSurface != nullptr )
cairo_surface_destroy( m_aGraphics[i].pSurface );
break;
}
}