removed crash on closing window with an active shader. Temporary patch!

This commit is contained in:
Guido Ranzuglia granzuglia 2012-03-16 17:46:58 +00:00
parent 306371eb5b
commit 7ff233990b
2 changed files with 4 additions and 3 deletions

View File

@ -106,7 +106,8 @@ GLArea::GLArea(MultiViewer_Container *mvcont, RichParameterSet *current)
GLArea::~GLArea()
{
// warn any iRender plugin that we're deleting glarea
if (iRenderer)
MeshDocument* md = this->md();
if (iRenderer && (md != NULL))
iRenderer->Finalize(currentShader, *this->md(), this);
if(targetTex) glDeleteTextures(1, &targetTex);
}

View File

@ -91,8 +91,8 @@ public:
MultiViewer_Container *mvc();
MainWindow *mw();
MeshModel *mm(){ return mvc()->meshDoc.mm();}
inline MeshDocument *md() {return &(mvc()->meshDoc);}
MeshModel *mm(){ if (mvc() == NULL) return NULL;return mvc()->meshDoc.mm();}
inline MeshDocument *md() {if (mvc() == NULL) return NULL;return &(mvc()->meshDoc);}
vcg::Trackball trackball;
vcg::Trackball trackball_light;