Permalink
Browse files

GLVideoDriver::~GLVideoDriver: don't crash if the shaders don't exist

now we finally exit gracefully
  • Loading branch information...
lynxlynxlynx committed May 4, 2014
1 parent 3bc037d commit f897b3558a9929535bcdd9d9fa5feca3deca72f4
Showing with 6 additions and 6 deletions.
  1. +6 −6 gemrb/plugins/SDLVideo/SDL20GLVideo.cpp
@@ -24,12 +24,12 @@ using namespace GemRB;
GLVideoDriver::~GLVideoDriver()
{
- program32->Release();
- programPal->Release();
- programPalGrayed->Release();
- programPalSepia->Release();
- programRect->Release();
- programEllipse->Release();
+ if (program32) program32->Release();
+ if (programPal) programPal->Release();
+ if (programPalGrayed) programPalGrayed->Release();
+ if (programPalSepia) programPalSepia->Release();
+ if (programRect) programRect->Release();
+ if (programEllipse) programEllipse->Release();
delete paletteManager;
SDL_GL_DeleteContext(context);
}

0 comments on commit f897b35

Please sign in to comment.