Pcbnew: Crash after running external plugin

Happens only in Opengl mode.
So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.

Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
This commit is contained in:
jean-pierre charras 2018-09-29 12:58:18 +02:00
parent 5843b1a6a1
commit 26838c6800
1 changed files with 6 additions and 3 deletions

View File

@ -1437,19 +1437,22 @@ void OPENGL_GAL::EndGroup()
void OPENGL_GAL::DrawGroup( int aGroupNumber )
{
cachedManager->DrawItem( *groups[aGroupNumber] );
if( groups[aGroupNumber] )
cachedManager->DrawItem( *groups[aGroupNumber] );
}
void OPENGL_GAL::ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor )
{
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
if( groups[aGroupNumber] )
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
}
void OPENGL_GAL::ChangeGroupDepth( int aGroupNumber, int aDepth )
{
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
if( groups[aGroupNumber] )
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
}