From a5e1d696acf3d11187bd2104d1b5e92c75a12ee0 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 28 Dec 2016 14:42:36 +0300 Subject: [PATCH] Issue #1937: Check that VBO array is initialized --- src/SketcherPrs/SketcherPrs_SymbolPrs.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index cb9e5990b..8a3a0fa7a 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -64,10 +64,13 @@ public: // Update points coordinate taking the viewer scale into account myObj->updateIfReadyToDisplay(MyDist * aScale); if (myIsVboInit) { - const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext(); - Handle(Graphic3d_Buffer) aAttr = myObj->myPntArray->Attributes(); - myVboAttribs->init(aCtx, 0, aAttr->NbElements, - aAttr->Data(), GL_NONE, aAttr->Stride); + if (myVboAttribs) { + const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext(); + Handle(Graphic3d_Buffer) aAttr = myObj->myPntArray->Attributes(); + myVboAttribs->init(aCtx, 0, aAttr->NbElements, + aAttr->Data(), GL_NONE, aAttr->Stride); + } else + myIsVboInit = false; } else { myAttribs = myObj->myPntArray->Attributes(); myIndices = myObj->myPntArray->Indices(); -- 2.39.2