From b5aadfc3f9306bd4804ad85bc27a38db1d0f1708 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 5 Jul 2013 15:48:45 +0200 Subject: [PATCH] Fixed segmentation fault when there was no board loaded. --- common/gal/opengl/opengl_gal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index c4887a2f86..cc43852dba 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -114,6 +114,9 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, // Compute unit semicircle & circle vertices and store them in a buffer for faster drawing computeCircleVbo(); + + // By default we draw non-cached objects, it changes on BeginGroup()/EndGroup() + currentContainer = &nonCachedVbo; } @@ -437,9 +440,6 @@ void OPENGL_GAL::BeginDrawing() // Prepare buffer for non-cached items delete nonCachedItem; nonCachedItem = new VBO_ITEM( &nonCachedVbo ); - - // By default we draw non-cached objects, it changes on BeginGroup()/EndGroup() - currentContainer = &nonCachedVbo; currentItem = nonCachedItem; }