Attempt to fix Coverity issue 168705.

This commit is contained in:
Wayne Stambaugh 2021-02-16 17:29:12 -05:00
parent e7227a4f21
commit b959378d58
1 changed files with 12 additions and 5 deletions

View File

@ -95,11 +95,18 @@ void CACHED_CONTAINER_GPU::Unmap()
// This gets called from ~CACHED_CONTAINER_GPU. To avoid throwing an exception from
// the dtor, catch it here instead.
glUnmapBuffer( GL_ARRAY_BUFFER );
checkGlError( "unmapping vertices buffer" );
glBindBuffer( GL_ARRAY_BUFFER, 0 );
m_vertices = NULL;
checkGlError( "unbinding vertices buffer" );
try
{
glUnmapBuffer( GL_ARRAY_BUFFER );
checkGlError( "unmapping vertices buffer" );
glBindBuffer( GL_ARRAY_BUFFER, 0 );
m_vertices = NULL;
checkGlError( "unbinding vertices buffer" );
}
catch( const std::runtime_error& err )
{
wxLogError( wxT( "OpenGL did not shut down properly.\n\n%s" ), err.what() );
}
m_isMapped = false;
}