]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1937: Check that VBO array is initialized
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 28 Dec 2016 11:42:36 +0000 (14:42 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 28 Dec 2016 11:42:36 +0000 (14:42 +0300)
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp

index cb9e5990b77fa21775ba339dbeb8521c0356f67b..8a3a0fa7a415209dc719e659faedd0e064a6181f 100644 (file)
@@ -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();